bash prompt

Unix administrators use a lot of fancy prompts for their shells. The prompt for the shell is set by setting the PS1 environment variable. Here is an example prompt that I like to use;

PS1="\$LOGNAME@`uname -n`:\$PWD # "

using the “\” before the $PWD makes it update when you change the working directory. If you don’t use it, PWD will not update. The above will result in a prompt that looks like this;

wfayed@macSmokey.local:/Users/wfayed # 

Leave a comment