Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Jul 9 '12 at 15:38

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

2  
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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.