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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...