FreeBSD has ls command to list directory contents. You can pass -G option to ls command to enable colorized output. For example, type following command at shell prompt to get colorized output:
$ export TERM=xterm
$ ls -G
But hold on you do not have to type ls –G every time, just create an alias as follows:
1) Simple use following alias
$ alias ls='ls –G'
2) Store above alias to ~/.bash_profile
3) You might need to change TERM variable to xterm-color. Use command:
export TERM=xterm-color
OR
export TERM=xterm
Put any of above command in your ~/.bash_profile file.
3) To customize color you need modify LSCOLORS variable and other stuff. Here is script to achieve this.
4) Call this script from your /etc/profile file.
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins

- My 10 UNIX Command Line Mistakes
- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
Facebook it - Tweet it - Print it -
We're here to help you make the most of sysadmin work. So, subscribe!

{ 2 comments… read them below or add one }
Hi,
The LSCOLOR dosent get set when i use the enablels.sh script.
I have included the script in my etcprofile Still its not working
This script works with BASH shell only. Do you have bash shell installed? Make sure it is your login shell! If so then make sure is called as follows from file /etc/profile or even from your ~/.bash_profile
. /path/to/enablels.sh