Stop Microsoft

Operating Systems => Linux and UNIX => Topic started by: Master of Reality on 15 February 2003, 02:16

Title: command line Q
Post by: Master of Reality on 15 February 2003, 02:16
in slackware how do i change it so that it says "mor@xen:/dir$" instead of the "bash-2.05a$" that comes up when i open a term.?
Title: command line Q
Post by: 5amYan on 17 February 2003, 11:30
I think in ~/.bashrc
#man bash
and look at the PS1 PS2 PS3 (Prompt String)entries
Title: command line Q
Post by: Calum on 17 February 2003, 19:00
yep, i get that bash2.05 thing too, because i deleted my .bashprofile or .bashrc or whatever (in a fit of rage). when i su to root, it gives me my current directory and all that crap before the # prompt, because root still has a .bashrc file.
Title: command line Q
Post by: untz on 18 February 2003, 04:57
cd into your home directory.

vi .bashrc

add the following

# set prompt: ``username@hostname:/directory $ ''
PS1="[\u@\h:\w] "
case `id -u` in
      0) PS1="${PS1}# ";;
      *) PS1="${PS1}$ ";;
esac

save it, exit your shell, and then next time you open it should work.