Chapter 6: Colorful and Functional Shell
Prompt Using PS1
Hack 34. Display username, hostname and basename of directory in the prompt
The PS1 in this example displays following three information in the prompt:
o \u – Username o \h – Hostname
o \W – Base name of the current working directory
-bash-3.2$ export PS1="\u@\h \W> "
ramesh@dev-db ~> cd /etc/mail
ramesh@dev-db mail>
0 comments:
Post a Comment