Jump to content

Add colors to directories, files, etc in the bash console.


mandrakewilson
 Share

Recommended Posts

How do I add colors to directories, files, etc in the bash console?

 

Easy. Add the following code to the .bashrc file located in your home directory:

 

alias ls='ls --color'

alias sl='ls --color'

 

An example of my .bashrc file with the above code added:

 

/usr/games/fortune homer

alias ls='ls --color'

alias sl='ls --color'

export PS1="[e[36;1m]u[e[32;1m]w >[e[0m]"

 

My example loads a Homer fortune, plus a nice, simple prompt with all the different colors for directories, images, links, etc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...