<2014.6.24>
Useful on the command line, to see what you're working with:
declare -p
<2016-01-27>
First, back up the copy of .bashrc
that came with Ubuntu:
anthony@anthony-VirtualBox:~$ cp -p .bashrc .bashrc.orig
Changed \w
(absolute path, I think) to \W
(“basename”, just the single directory name):
if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else # orig. line: # PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' # adc changed 2016.01.27: PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W\$ ' fi
Based on advice from:
http://askubuntu.com/questions/16728/hide-current-working-directory-in-terminal
http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html