How to change computer name and user name in terminal command prompt in MacOS

Sometimes we want to hide the system name or username that is displayed on the Terminal.

May be to take some screenshot and then paste it in the blog and we want to hide the System name/user Name etc.

For Bash based terminals it can be done by setting PS1 variable.

Example on the terminal

$ export PS1="> "
>

$ PS1="Mac:~sidd:"
Mac:~sidd:

$ export PS1="This is Demo Terminal: $ "
This is Demo Terminal: $


Change your prompt in your  profile file to make it permanent across all Terminals and new sessions.


Comments

Popular posts from this blog

Difference between volatile and synchronized

Converting Java Map to String

Masking Credit Card number in Java