Color output from ls – based on file type

2010-02-04 1 min read bash Linux

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="" target="_blank">here.

comments powered by Disqus