Next | Unix Command Internals | 13 |
ls is a little tricky
When it runs, it makes an fstat call on its standard output
Among other things, this tells it whether stdout is a file or a terminal
If it's a terminal, it enables the column-formatting and color options
If not, it doesn't
You can override this behavior with explicit command-line flags:
ls -1 (single column)
ls -C (multiple columns)
ls --color=never
ls --color=always
Next | Copyright © 2002 M. J. Dominus |