設定背景
普段はWindows側のGUIでファイルを管理していますが、
一部コマンドラインで操作したりしています。
普段使いしているとディレクトリ構造が深くなりがちなので
カレントディレクトリだけ表示するようにした。
itnewcomer@hogehoge:/home/itnewcomer/work/test/sample01$ ←長い
itnewcomer@hogehoge:sample01$ ←カレントだけにする
やったこと
~/.bashrc
のPS1の値で使われている/w
を/W
に変更する
Before
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
After
if [ "$color_prompt" = yes ]; then
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
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\$ '
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W\$ '
fi
完全に備忘録