Shorten Path In Terminal Ubuntu 18.04

Just Type in Your terminal And Enter.

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '

For Permanently, you can edit file .bashrc find the following section:

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\[email protected]\h:\w\$ '
fi

Source : https://askubuntu.com/questions/145618/how-can-i-shorten-my-command-line-bash-prompt

Tags: ,

Leave a Reply