The prompt is defined by the environment variable
PS1 which you can define in
To edit it, open or create the (hidden) file
and add a line that says
Between the quotation marks, you can insert what you would like as your terminal prompt. You can also use variables there:
\#– command number
\W– current directory (e.g.: Desktop)
\w– current directory path (e.g.: /Users/Admin/Desktop)
The default prompt for common Linux distributions would be
\w $, which evaluates to
~ $ in your home directory or e.g.
/Users $ somewhere else. There are also website (like this one) that can help you with building your prompt.
If you want to remove the
UserName part, your choice would be
Once you made your changes, save the file with Control+o, Return, Control+x.