Q:

What is the difference between 'ls --color' and 'ls --color=tty'?

I am making an alias for ls in my .zshrc profile so that it always has a colored output. As it turns out, I stumbled across either
alias ls="ls --color=tty"

or, without the tty value
alias ls="ls --color"

Is there any particular situation where either the commands $ ls --color=tty and $ ls --color, or the above aliases, can behave differently ?

A:

With no argument attached to the option (--color), the output is always colorized. With --color=tty, it is only colorized when stdout is connected to a tty. This matters when the output of ls is piped or redirected.

