Color output from ls – based on file type

2010-02-04 101 words 1 min read

Threre are certain default variables which control the color of the output from the ls command, so we will talk about them today.

The first one is to get the color output from the ”ls” command. We will look at the various ways to do this:

First is to use this with default colors:

ls –color=auto

Now this will use the default colors which might not go with your liking 🙂 So if you want to change the colors you can use the variable called LS_COLORS.

export LS_COLORS=’di=1:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rb=90’

There is another  variable called CLICOLOR which is described well <a href="http://lantech.geekvenue.net/chucktips/jason/chuck/1092014257/index_html" target="_blank">here.


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it