The Rules
  • Feel free to leave constructive criticism, or point out a better way to do something.
  • Personal attacks or flames, on me or anyone else, will be deleted.
  • Past history has shown that 99% of comments I can't read (i.e. those in other languages) to be spam. Therefore, any comment I can't read will be removed.
  • I'm pretty mellow concerning profanity, but excessive (as determined subjectively by me), bad language will be removed.

Thursday, April 8, 2010

Terminal colors, all-day readability, and Arch Linux

A recent system upgrade broke my terminal colors. I don't know what exactly it was, or how it happened, but I opened a new terminal window, did a `ls`, and all my directories were bold and blue again. I personally find this difficult to read as I use a very dark blue background in my terminals (something on the order of #111133).

The solution:

Run the following command to create a default dir_colors file (the file that generates the colors for the ls command):

    `dircolors -p > ~/.dir_colors`
Then, add the following to your .bashrc file:
    # set the TERM variable to a color-enabled type (xterm-color)
export TERM="xterm-color"

# source my own .dir_colors file
if [ -f $HOME/.dir_colors ]
eval `dircolors -b $HOME/.dir_colors
This will allow you to customize what colors describe what objects for the ls command.

I personally make the following changes in ~/.dir_colors:
- DIR 01;34
+ DIR 00;36 # directories are cyan and non-bold
Then, I go through and turn off bold (swap 00 for 01) for almost everything. The only things I leave bold are executables and sym/hardlinks. For more info on dir_colors, see
    man dircolors
    man dir_colors

No comments: