Colors in ls

General Information

Ever wanted an easy way to distinguish directories and executables from everything else while you’re ssh’ed in to your FreeBSD box? You may have seen colors using ls on some Linux distros such as SlackWare but now you can have it on your FreeBSD machine.


  1. Local root access on the box or be able to su to root.
  2. A SSH client that supports ANSI colors such as puTTy or SecureCRT.
  3. Your favorite text editor (I prefer nano).


Note: This only works if your shell is bash.

Logon to the machine as root or su to root.

# cd /usr/ports/misc/gnuls
# make install
# make clean
# cd /etc
# nano profile

Add the following:

alias ls="gnuls --color=always"

Log out and back in and enjoy.

Speak Your Mind