Bash

From Wiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 17:06, 26 June 2007

Change the Shell Prompt

I found that particularly with Centos 5, that the default shell prompt for root was terrible. It did not show the pwd, user or host!

Before

-bash-3.1# ls

Showing no present working directory, no current username, no hostname


Syntax

PS1='\u@\h:\w\$ '

There are a few other things one can show also. Such as the time, date, FQHN etc. man bash for the full list.


After

root@volcano:/tmp# ls

Ref.: http://www.builderau.com.au/program/linux/soa/10-shortcuts-to-master-bash/0,339028299,339279043,00.htm

Personal tools