MacOS Terminal – Changing Terminal Color

bashmacos

I would like to know how to change the terminal color, so whenever I run
ls it will return the name of:

  • Directories in red
  • Files in blue
  • Executable files (those you do ./file) in light green

How do I do that?

Best Answer

Usually this is done with

ls -G

Personally I'm using an alias, e.g. in .bash_aliases which is loaded by .bash_profile

alias ls="ls -G"

However, there's another option, i.e. turning on CLICOLOR in your shell, e.g. by adding the following to your .bash_profile

export CLICOLOR=1