Last Updated: February 25, 2016
·
841
· enno

ash: show current directory in terminal

Unlike bash, ash has no PROMPT_COMMAND variable, so if you want the current directory to show up in your terminal window's title bar (or the name of your PuTTY window), here's what to add to ~.profile:

HOSTNAME=`hostname`
PS1='`echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"`\u@\h \w '

After that, just log out and back in, or source ~/.profile and you're all set. Makes going through multiple windows with Alt-Tab that much more pleasant.