FreeBSD > How to enable colorized ls output?
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.
E-mail this to a Friend
Printable Version
Capture each and every moment of life with a FREE 4 GB SD memory card with the purchase of select digital cameras from Canon, Nikon, Pentax and others from Amazon
You may also be interested in other helpful articles:
- Start and stop VMWARE VPS / virtual machine guest operating system from command line
- FreeBSD Forums Launched
- Download of the day: FreeBSD 7.0 ISO / CD Image
- Linux Iptables allow or block ICMP ping request
- FreeBSD keep ports collection up to date in two easy steps
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


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