Leia man bash
, a seção PROMPTING e a variável de ambiente PROMPT_DIRTRIM
.
PROMPT_DIRTRIM
If set to a number greater than zero, the value is used as the number of trail‐
ing directory components to retain when expanding the \w and \W prompt string
escapes (see PROMPTING below). Characters removed are replaced with an ellip‐
sis.
Adicione export PROMPT_DIRTRIM=1
a ~/.bashrc
e você chegará perto do que deseja.