KaliLinux 2017.1: Shorten bash prompt string

This article will describe shortening bash prompt string.

1 Change \w to \W in ${HOME}/.bashrc

Debian based distribution have long prompt string by default which includes full path of current directory.

hiroom2@linux:/var/lib/git$

Change full path of current directory to current directory with changing \w to \W in ${HOME}/.bashrc.

$ sed -i -e 's/\\w/\\W/g' ~/.bashrc
$ . ~/.bashrc

Now bash prompt string is shortened.

hiroom2@linux:git$

After this change, bash prompt string is shortened by default.