In Windows, we have seen prompt command in command prompt(cmd) to change the prompt of the cmd.
Today I am going to discuss about same thing for linux.
In Linux, PS1 shell variable sets the prompt. We can use this variable to set our own custom prompt with the use of special escaped sequences.
Here, are few common escape sequences:
\h - short hostnameSetting custom prompt using special escaped sequences:
\u - username
\w - current working directory
\! - history number of the current command
\$ - this shows the privilege i.e for root users # and for non-root users $
1. temporary change:
$ PS1="\u@\h: \w \$" this will give you prompt something like this:
prabindatta@localhost: /home/prabindatta $
2. to make this change permament:
$ vi /.bashrc
at the end append your line something like this:
PS1='\u@\h: \w \$'