Friday, November 30, 2012

How to set the standard shell prompt in aix servers?

How to set the standard shell prompt in aix servers?


1. Pre-work:

          Make sure to take the copy of the /etc/profile file using the below command.
             cp -p /etc/profile /etc/profile_old

2. Steps:

Append the following lines to the file /etc/profile to change the format of the shell prompt.
         PS1=`whoami`@`hostname –s`: '$PWD>'
         export PS1


For example you login as a root to the server test_server and you are in /etc the prompt look like the following:   Syntax: username@servername:presentworkingdirectory>    
              root@test_server:/etc>


3. Validation:
                Open a new login session and you should see the change in shell prompt.

4. Roll back:
               Remove the entry that you have added to the file “/etc/profile”