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

Trying to get --color=auto as the default ls argument.

$  ls --version
ls (GNU coreutils) 8.21
$  echo $LS_COLORS
$  echo $LS_OPTIONS

Unfortunately when I run ls I still get non-colored output (running ls --color=auto manually gives me colors).

How do I make --color=auto a default ls argument?

share|improve this question
Is ls aliased with different options? Try 'type ls' to see if it is aliased. \ls should run the unaliased ls. – jaychris Nov 6 '13 at 5:11
Thanks, but all I get there is an absolute path to the ls I installed to $HOME\opt\bin\ls – A T Nov 6 '13 at 13:46
up vote 1 down vote accepted

I think you might have thought that GREP_OPTIONS being supported implies that LS_OPTIONS would be too, as in:

This is not the case though, so you're best doing something like this in your bashrc or equivalent:

alias ls='ls --color=auto'
share|improve this answer
I heard that using alias where an environmental variable can be given instead isn't recommended… all well, it's working now – A T Nov 8 '13 at 3:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .