Tuesday, November 10, 2009

Setting the System PROMPT "$"

The system primary prompt is set with the environment variable PS1.  
The secondary prompt is set with the environment variable PS2.   

You can set these variables by typing:

        export  PS1=’(system name)#’


Example:

      System1#

For the present working directory to show on your prompt, type:

        export  PS1=’(system name):$PWD>>’


Example:

       System1:/etc>>

For the userid and the present working directory to show on your prompt, type:

        export  PS1=’(system name):$LOGNAME:$PWD>>’


Example:

       System1:(user name):/etc>>

Note:  If you want to set a default prompt, put one of the above lines in the .profile file in your /home directory.  Every time you log in, it will create the desired prompt.

If you want to set a default prompt, the idea is the same but put it in the global profile file located at /etc/profile 


As always let me know if you have any question


;-)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.