Tuesday, February 17, 2009

Change the Linux Prompt

To make your Linux prompt more informative, you need to change your Linux prompt. Suppose, you want to change your prompt like this :


-bash-3.2#

Become like this :

root@ppin-msmunir2:~ #

This prompt give more informations such as who are you, where you are, what is your level, and so on. It's easy to do that, just add one line below on the end of /etc/profile file.

Code :

export PS1="\u@\h:\w # "

Or, your prompt become like this :

[root@ppin-msmunir2:~ ] #

Just add one line below on the end of /etc/profile file

Code :

export PS1="[\u@\h:\w ] # "

Others sintax :

$ PS1="\h>" --> show hostname dan character >

$ PS1="\u~" --> show recent user and character ~

$ PS1="\W" --> show current directory

$ PS1="\u@\h" --> show user, "@", and hostname



No comments:

Post a Comment