Как мне увидеть в командной строке терминала полный путь к домашнему каталогу?
То есть с
root@pcname:~ #
по
root@pcname:/home/username #
В Вашей подсказке (ищут PS1
в Вашем .bashrc
), используйте $PWD
вместо \w
.
Например, Ваш .bashrc
содержал бы:
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
В обоих случаях измените второе \w
кому: $PWD
:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]$PWD\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:$PWD\$ '
fi
Согласно man bash
, \w
сокращенный путь:
\w the current working directory, with $HOME abbreviated with a tilde (uses the value of the PROMPT_DIRTRI`M variable)