Tuesday, February 3, 2015

Change terminal work place to look like [02:43:14]/h/r/Desktop:

PROMPT_COMMAND='pwd2=$(sed "s:\([^/]\)[^/]*/:\1/:g" <<<$PWD)'
export PS1='\[\033[1;35m\][\t]\[\033[1;33m\]$pwd2\[\033[1;36m\]: '


Put the above two lines in the .bashrc file and re-login. Change \numbers to edit the colour.

3 comments:

  1. There seems to be a color imbalance, unless you the command text color in cyan.

    Also, you may want to try mine -

    PS1="\[\e[01;32m\]\h\[\e[00;33m\] \T \[\e[01;31m\]$?\[\e[01;34m\] \[\e[01;34m\]\w\[\e[00m\]"

    ReplyDelete
    Replies
    1. This one is also cool. I would put a space at the end of directory.

      Delete
    2. This comment has been removed by the author.

      Delete