Change the last \w to \W of PS1 environment variable.
From man bash :
\w : the current working directory, with $HOME abbreviated with a
tilde (uses the value of the PROMPT_DIRTRIM variable)
\W : the basename of the current working directory, with $HOME abbreviated with a tilde
So you need :
PS1='[\e]0;\u@\h: \w\a]${debian_chroot:+($debian_chroot)}\u@\h:\W\$ '
In ~/.bashrc, there is this snippet :
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
you can basically change the \ws to \Ws or you can selectively change matching your needs. otherwise you can put your desired PS1 value at the end of the ~/.bashrc file to override them all. As upon starting of a login shell ~/.profile sources ~/.bashrc it will be available in all login and non-login interactive sessions.
If you want to make it applicable to all users you should look at /etc/bash.bashrc and remove the relevant PS1 snippets from individual ~/.bashrc files.
echo "$PS1"?