3 ms·
The moment you pipe ‘ls’ it will fallback to using just one column. In fact a great deal of CLI tools (and particularly coreutils like GNU) will have nice usab
by laumars 8y ago
The moment you pipe ‘ls’ it will fallback to using just one column.
In fact a great deal of CLI tools (and particularly coreutils like GNU) will have nice usability features this will auto-disable the moment the output file is not a TTY.
For example, run the following commands and compare the output:
ls ~
ls ~ | cat
grep --color=auto ${hostname} /etc/hosts
grep --color=auto ${hostname} /etc/hosts | cat
You might be surprised at just how different and predictable the terminal utilities behave when they detect they’re being piped.