Pimp your ls

Here are some of the things that you can do with your ls command.

First off you can use alias\’s to help you type the most typical ls commands. I will give you some examples:

alias ls =\”ls –color –classify\”
alias ls.=\”ls -d .*\”

Very commonly used :

alias ll=\"ls -lhvrt\"
lsd=\"ls -lUd */\" # List directories only

And after all this you can download the l script from pixelbeat. Quite interesting:



Color output from ls – based on file type

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 here.