Rob Righter

  • Archive
  • RSS

How to fix the directory color of the ls command on Mac OSX

It is much easier on my eyes to have a terminal with a dark background and light colored text. However, on Mac OS X the ls command displays directories as dark blue. Dark blue is almost impossible to read on a dark background. The ls command on Mac OS X does not support the —color option.

So my solution is to install a better ls. Here are the steps:

(1) Install Homebrew (if you haven’t already)

(2) brew install coreutils

(3) Edit your .bashrc (or .zshrc if your into that) to include the following lines:

alias ls='/usr/local/Cellar/coreutils/7.5/bin/gls --color=auto'
LS_COLORS='di=01;33'; export LS_COLORS

This will change your terminal from:

Broken Directory colors in mac osx ls

To this:

Fixed directory color for ls on Mac OS X

  • 1 year ago
  • Permalink
  • Share
    Tweet
← Previous • Next →

About

Just another computer geek.

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr