Taking command of command Line - 6
Changing Prompt
Why change prompt?
Whenever we open the terminal or command line in windows we see a long path where we are sometimes it helps. Some time the length of the prompt make us annoying isn’t it.lets see how to change the prompt and then customise the name what you like.
On Unix-Like machines.
Just use export PS1=“>” this will come up with a > instead of showing the file path you're in. It is not mandatory to give > in “” give what ever you like give the user name and so on .
For eg export PS1=“USER:>” this will give you USER:> for line of the input.
This stands good for bash shell please find other tricks for different shells.
In Cygwin its stands the same as in Mac.
For Windows
Its an easy trick here just use prompt $G will give you the > symbol
Or say prompt user where user - is give the option of your choice.
Eg Before using setting up prompt C:\User\Jagadish\>
After giving a command prompt Hello:> it will show your Hello:> for further usage of your command inputs.
Comments
Post a Comment