Altere a última variável de ambiente \w para \W of PS1 .
De 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
Então você precisa:
PS1='[\e]0;\u@\h: \w\a]${debian_chroot:+($debian_chroot)}\u@\h:\W\$ '
Em ~/.bashrc , há este snippet:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[3[01;32m\]\u@\h\[3[00m\]:\[3[01;34m\]\w\[3[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
basicamente, você pode alterar o \w s para \W s ou pode alterar de forma seletiva as suas necessidades. caso contrário, você poderá colocar o valor PS1 desejado no final do arquivo ~/.bashrc para substituí-los todos. Assim como no início de um shell de login ~/.profile sources ~/.bashrc , ele estará disponível em todas as sessões interativas de login e não-login.
Se você quiser torná-lo aplicável a todos os usuários, consulte /etc/bash.bashrc e remova os PS1 snippets relevantes dos arquivos ~/.bashrc individuais.