Changing your command prompt in BASH

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

If, like me, you want to know what directory you’re working in on Linux, make sure you visit this page: “Prompt Magic

It shows you all the beautiful things you can do to make sure your BASH command prompt looks pretty, and informative. You do this by setting your “PS1” environment variable, and the key value I would say you need is “w”, which shows your full current working directory.

My host had mine set to “W” which only shows the last directory of you current working directory, but having 3 (or more) WordPress installs, being in the “plugins” directory doesn’t help much if I’m moving things around a lot…

Just thought I’d share this one…

UPDATE: Guess I should show how it’s done… In your .bash_profile file in your home directory (which you can get to by typing the command “cd ~”), add (or edit if it exists) a line that says:

export PS1=”\w>> “

This should make you command prompt look similar to the following if you are in the /usr/bin directory:

/usr/bin>> _

Leave a Reply