Remove User and Hostname in Terminal Prompt MAC

June 08, 2019 | 6 comments
For Linux and Mac the default Terminal or ITerm2 terminal the default prompt shows the hostname, current directory etc.
As shown in the above image it is in the format of [username@hostname CURRENTDIR]$

Terminals shows the primary prompt PS1 when it is ready to read a command, and the secondary prompt PS2 when it needs more input to complete a command. These prompt strings can be customized by inserting a number of backslash-escaped special characters some of them are as follows:
\d : the date in “Weekday Month Date” format (e.g., “Tue May 26”)

\h : the hostname up to the first ‘.’

\H : the hostname

\n : newline

\r : carriage return

\t : the current time in 24-hour HH:MM:SS format

\V : the release of bash, version + patch level (e.g., 2.00.0)

\w : the current working directory, with $HOME abbreviated with a tilde

\W : the basename of the current working directory, with $HOME abbreviated with a tilde

\! : the history number of this command

\# : the command number of this command

\\ : a backslash
Good thing is that it is configurable.  To change it temporarily do the following in the terminal

Now the Terminal shows something like follows.

To change the behaviour we need to update the .bash or .bash_profile file as per the bash configuration.

And then save the changes and do source ~/.bashrc
Now open a new Terminal and it should reflect the changes.


  1. Thanks for your nice post, i am interested to learn online freelancing, but firstly i have to learn computer , could you suggest me please which computer training center best.

    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery

  2. Keep up the good work; I read few posts on this website, including I consider that your blog is fascinating and has sets of the fantastic piece of information. Thanks for your valuable efforts. traffic secrets


Please leave your message queries or suggetions.