Quantcast
Channel: blog.strug.de » bash
Viewing all articles
Browse latest Browse all 2

How To Color Up Your Terminal

$
0
0

Terminal Coloring
Here is what is necessary to achieve the above layout and coloring. I want these changes for all my accounts on my laptop, so I edit the /etc/bashrc.

# terminal coloring
export CLICOLOR=1
export LSCOLORS=dxfxxxxxbxegedbxbxdxdx

CLICOLOR=1 enables the coloring. LSCOLORS defines the coloring. There are 11 attributes that can be colored. Each attribute has a foreground and a background color. A color is represented by a single character, now we have our 22 character string: dxfxxxxxbxegedbxbxdxdx. See the manual of ls and search for LSCOLORS for details.

Prompt
I like to have the prompt always at the same spot and want to see the full path of the working directory. Therefore I change the default prompt:

# two line prompt with full path
PS1='\[\e[0;32m\][\w]\n\u@\h$\[\e[m\] '

Explained:

  '\[\e[0;32m\]     change font to green
  [\w]\n            current working directory + newline
  \u@\h$            user@host$
  \[\e[m\] '        stop the green coloring and add a trailing space

What else is possible? See enhance the system prompt.


Viewing all articles
Browse latest Browse all 2

Trending Articles