David Xia

How to Color Code Mac OS Lion’s “ls” Command

Stick this into your shell’s rc file. If you use bash, .bashrc. I use zsh, so .zshrc.

# make ls display colors, reinforce with CLICOLOR and LSCOLORS
export CLICOLOR=1
 
# LSCOLORS order: DIR, SYM_LINK, SOCKET, PIPE, EXE, BLOCK_SP
# CHAR_SP, EXE_SUID, EXE_GUID, DIR_STICKY, DIR_WO_STICKY
# a = black, b = red, c = green, d = brown, e = blue,
# f = magenta g = cyan, h = light gray, x = default
# lowercase is bold
export LSCOLORS=gxex

This particular LSCOLORS configuration makes directors bold cyan and sym links dark blue. All the rest are default.

Post a comment or leave a trackback URL.

2 Comments

  1. September 1, 2011

    Thanks for that man really helped, thumbs up! :D

One Trackback

  1. [...] Xia, i'll put something here soon 1 vote by Anon UserThis worked for me. http://www.davidxia.com/2011/08/…This answer .Please specify the necessary improvements. Edit Link Text Show answer summary [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">