Saturday, February 6, 2016

Shorten Command line Bash Prompt

So to shorten the Bash Prompt just do the following changes:

  • Change for the current terminal instance only
    • Terminal# PS1='\u:\W\$ '
  • Change permanently
    1. Terminal# vi ~/.bashrc
    2.  Find the line
      • PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    3. Changes needed; of course you can copy a line in case you wanna change back
      • Remove '@h\' and replace '\w' with uppercase '\W'
    4. Save, exit and restart a new terminal

Reference

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

No comments:

Post a Comment