3

How can I set Bash so that in the command line prompt the home folder is spelled out (e.g. /Users/John) instead of displayed with the ~ symbol?

3

In your .bashrc, look for PS1. Replace \w with $PWD or $(pwd -P), then run source ~/.bashrc to reload the file.

($PWD contains the shell's idea of the working directory, some parts of the path may be symbolic links. $(pwd -P) gets the "physical" path, with intervening symlinks resolved.)

| improve this answer | |
  • Using $PWD instead of a command substitution would be more efficient. – Kusalananda Aug 22 '19 at 5:28
  • I use the command because of an alias to pwd -P. – ajgringo619 Aug 22 '19 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.