Skip to content

Instantly share code, notes, and snippets.

@mariohercules
Last active May 27, 2019 13:47
Show Gist options
  • Save mariohercules/9f8fd86e9f87267587d6751828dbdc58 to your computer and use it in GitHub Desktop.
Save mariohercules/9f8fd86e9f87267587d6751828dbdc58 to your computer and use it in GitHub Desktop.
Customize Terminal Prompt

1 - Navigate to your home directory

$ cd ~

2 - Create a file called .bash_profile

$ vi .bash_profile

3 - Add the following line (press i)

export PS1="$ "

4 - Save the file (press Escape, type :wq and hit Enter)

5 - Restart Terminal

OPTIONS

\d – Current date
\t – Current time
\h – Host name
\# – Command number
\u – User name
\W – Current working directory (ie: Desktop/)
\w – Current working directory with full path (ie: /Users/Admin/Desktop/)

EXPERIMENTS

export PS1="\u@\h\w: "

Results:

Admin@MacBook~Desktop/: "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment