How to turn off color with `ls`?
Color output for ls
is typically enabled through an alias in most distros nowadays.
$ alias ls
alias ls='ls --color=auto'
You can always disable an alias temporarily by prefixing it with a backslash.
$ \ls
Doing the above will short circuit the alias just for this one invocation. You can use it any time you want to disable any alias.
With GNU ls
, you can specify ls --color=never
to explicitly disable color output. (Even if you have an alias ls='ls --color=auto'
, when you run ls --color=never
, it will expand to ls --color=auto --color=never
, and the later option takes precedence.)
You can also simply use (as on DOS):
dir
It will show the results without color, you can add the arguments same to ls
, like -l
.