ls \- list contents of directory
but has three possible listing formats.
The format chosen depends on whether the output is going
to a teletype, and may also be controlled by option flags.
The default format for a teletype is to list the contents of directories
in multi-column format, with the entries sorted down the columns.
If the standard output is not a teletype, the default format is to
Finally, there is a stream output format in which files are listed
across the page, separated by `,' characters.
flag enables this format.
Files which are not the contents of a directory being interpreted
are always sorted across the page rather than down the page in columns.
This is because the individual file names may be arbitrarily long.
force stream output format
force one entry per line output format, e.g. to a teletype
force multi-column output, e.g. to a file or a pipe
force printing of non-graphic characters in file names as
the character `?'; this normally happens only if the output device is
force columnar printing to be sorted across rather than
this is the default if the last character of the name the program is invoked
with is not an `l' or an `s'.
/etc/passwd to get user ID's for
Newline and tab are considered printing characters in file names.
Output device is assumed to be 80 columns wide.
Columns are basically 15 characters wide, 20 characters wide if
.BR \-i " or " "\-s\fR is specified, 25 characters wide if both"
.BR \-i " and " "\-s\fR are specified."
only one entry will fit per line.
The option setting based on whether the output is a teletype is
On the other hand, not doing this setting would make old shell scripts
and then one could no longer do, e.g.:
Column widths choices are poor for terminals which can tab.