Antworten:
Der Teil vor dem $ in einer Shell heißt prompt. Sie kann durch Ändern der Variablen konfiguriert werden $PS1. Es gibt eine ähnliche Frage mit guten Antworten .
Die Manpage (siehe "Bash" und dort "PROMPTING") sagt:
\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
Also muss man umsteigen \wauf \W. Wahrscheinlich ist der Anfangswert für $ PS1 in Ihrem gespeichert .bashrc, das heißt, Sie müssen die Datei bearbeiten ~/.bashrcund finden folgende Zeilen:
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
Ändern \wzu \Win beiden Linien und ein neues Terminal (oder läuft source ~/.bashrc).