How to set the prompt os it shows current working directory

Dave Martini martini at mrpeabody.llnl.gov
Wed Nov 8 23:42:53 UTC 2006


How do I set the prompt in RHEL 4 so that it shows the current working 
directory when you login and whenever you change directories. When I 
initially log in it doesn't show me the home directory of the oracle 
account. When I cd to /u01 it shows that in the prompt and then when I 
cd to /u01/app it shows that but when I then cd to oracle it doesn't 
show it.

I have this command in my .bash_profile is this correct?

export PS1="[\h:\w]$ "

Thanks,
Dave Martini
LLNL

[root@~]# su - oracle
[ct:~]$
[ct:~]$ pwd
/u01/app/oracle
[ct:~]$ cd /u01
[ct:/u01]$ cd app
[ct:/u01/app]$ cd oracle
[ct:~]$
[ct:~]$
[ct:~]$
[ct:~]$ more .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
         . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
export PS1="[\h:\w]$ "
[ct:~]$




More information about the redhat-list mailing list