Friday 11 August 2017

How to hide the default bash prompt and use desire prompt

When you login into a linx or unix user, you will be falling under the home directory and the home directory sometime be in a path which is lengthy. You will find it difficult in a small terminal display to type your command.

for example:
  home directory would be like below
      username@hostname format>

  or username:pathOftheUserHome>
   

We can change the prompt as desired. For example

username>

hostname>

anyName>

here is the example how we can change the prompt.

export PS1='\u>'   outpiut: oracle>

export PS1='\h>'  output:   example>

export PS1='\u@\h>'  output: oracle@example

export PS1='Manoj>'  output Manoj>


You can put this in .bash_profile to load this prompt when you login to the user.


Hope this article will help.