Я использую Ubuntu 10.10, и теперь я получил в оболочке что-то вроде этого:
machine1user@mylinux:~:
, как я могу изменить его на
machine1user@mylinux:/my/current/path :~: ?
Откройте ~/.bashrc
в вашем текстовом редакторе. Найдите это:
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"
и измените его следующим образом:
PS1='${debian_chroot:+($debian_chroot)}\u@\h:$PWD\$ '
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: $PWD\a\]$PS1"
В частности, вы заменяете \w
на $PWD
. Первая ссылка устанавливает текст для вашей командной строки; вторая устанавливает заголовок, который обычно отображается в строке меню вашего терминала.