Operating Systems > Linux and UNIX

command line Q

(1/1)

Master of Reality:
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.?

5amYan:
I think in ~/.bashrc
#man bash
and look at the PS1 PS2 PS3 (Prompt String)entries

Calum:
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.

untz:
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.

Navigation

[0] Message Index

Go to full version