Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to make a few changes to my bash profile. Changes I would like include:

  • Coloring Files: I would like files with the execute permission bit set to be colored green.
  • I would like to know how to assign different file extensions to different colors when the ls command is run.
  • I would like ls to append an * to the end of file names with the execution bit set.
  • I would like to color setuid executable files a different color.

How would I implement this using my .bashrc file?

share|improve this question

migrated from Jul 9 '12 at 15:38

This question came from our site for professional and enthusiast programmers.

Most of it can be achieved with alias ls='ls --color=auto'. – Banthar Jul 9 '12 at 15:08
alias ls='ls -F' for appending an '*' to executables – amc Jul 9 '12 at 15:14

Summarizing from the other suggestions: Put this in your .bashrc (or preferably, .bash_aliases):

alias ls="ls -F --color=auto"

Also, a good read would be man dircolors.

share|improve this answer

You must log in to answer this question.