Skip to content

Instantly share code, notes, and snippets.

@vargeorge
Created September 4, 2014 20:45
Show Gist options
  • Save vargeorge/8b20488b7d7b6c101b4b to your computer and use it in GitHub Desktop.
Save vargeorge/8b20488b7d7b6c101b4b to your computer and use it in GitHub Desktop.
Show full path on OS X terminal / iTerm before the $ prompt
1. Edit ~/.bash_profile and add the following line to show full path before the $ prompt.
For example, as user@hostname:path/to/directory$
# show path before the $ prompt
export PS1='\u@\H:\w$ '
2. Save file and restart terminal or run source command
$ source ~/.bash_profile
@AAwadallahAtypon
Copy link

On Big Sur it somehow prints the expression:

\u@\H:\w$

Never worked with zsh before. Does zsh use another config file than bash?

add PROMPT='%~ %n@%m:%# ' to ~/.zshrc

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