lost and found ( for me ? )

Showing posts with label trim directory paths. Show all posts
Showing posts with label trim directory paths. Show all posts

Ubuntu 11.04 : how to trim directory paths in bash prompt

This method is configurable on bash 4.
# bash --version | head -1
GNU bash, バージョン 4.2.8(1)-release (x86_64-pc-linux-gnu)

edit ( make )  ~/.bashrc file and add the following line.
# tail -1 /root/.bashrc
export PROMPT_DIRTRIM=1

before
root@ubuntu-2:~/dir1/dir2/dir3/dir4#

after
# cd dir1/dir2/dir3/dir4/
root@ubuntu-2:~/.../dir4#

that’s it