RE: How to set the prompt os it shows current working directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PS1="\u@\h: \w "
case `id -u` in
      0) PS1="${PS1}# ";;
      *) PS1="${PS1}$ ";;
esac
 
 
Best Regards,
Jeremy Eder
UNIX Administrator
INVISION.COM
631.543.1000 x5334

________________________________

From: redhat-list-bounces@xxxxxxxxxx on behalf of Dave Martini
Sent: Wed 11/08/2006 18:42
To: Red Hat List
Subject: How to set the prompt os it shows current working directory



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:~]$

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux