Setting the shell prompt to display directory path information.

Alexander Dalloz ad+lists at uni-x.org
Wed Nov 24 15:57:01 UTC 2004


Am Mi, den 24.11.2004 schrieb David Hodge um 15:09:

> I want to be able to display the full path to where I currently am in
> the file system on the shell prompt like:
> 
> [userid/directory/subdirectory/subdirectory]  I think that the
> following will do the job:
> 
> PS1="[\u\w]"
> 
> Now where do I place this setting so that it executes when I or any
> other users logs in to an FC2 server console.

I have in my ~/.bashrc - the .bashrc file in the user's home directory -
following PS1 (1 single line, no break):

PS1='\n\[\033[1;34m\][\d \t]\[\033[00m\]
\[\033[0;31m\][\u@\h]\[\033[00m\] \[\033[0;36m\]<`tty | sed -e
"s:/dev/::"`>\[\033[00m\]
\[\033[0;33m\]`pwd`\[\033[00m\]\n\[\033[1;31m\]\n\W\[\033[00m\] $ '

You could too change the default setting in /etc/bashrc, which comes
form following line:

[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

Btw. you can simply try out the PS1, it will not damage anything and you
can easily comes back to the standard and simple one.

Alexander


-- 
Alexander Dalloz | Enger, Germany | new address - new key: 0xB366A773
legal statement: http://www.uni-x.org/legal.html
Fedora GNU/Linux Core 2 (Tettnang) on Athlon kernel 2.6.9-1.6_FC2smp 
Serendipity 16:54:21 up 4 days, 11:41, load average: 0.10, 0.26, 0.26 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20041124/3422bce9/attachment-0002.bin 


More information about the users mailing list