coreutils: General output formatting
1
1 10.1.5 General output formatting
1 --------------------------------
1
1 These options affect the appearance of the overall output.
1
1 ‘-1’
1 ‘--format=single-column’
1 List one file per line. This is the default for ‘ls’ when standard
1 output is not a terminal. See also the ‘-b’ and ‘-q’ options to
1 suppress direct output of newline characters within a file name.
1
1 ‘-C’
1 ‘--format=vertical’
1 List files in columns, sorted vertically. This is the default for
1 ‘ls’ if standard output is a terminal. It is always the default
1 for the ‘dir’ program. GNU ‘ls’ uses variable width columns to
1 display as many files as possible in the fewest lines.
1
1 ‘--color [=WHEN]’
1 Specify whether to use color for distinguishing file types. WHEN
1 may be omitted, or one of:
1 • none - Do not use color at all. This is the default.
1 • auto - Only use color if standard output is a terminal.
1 • always - Always use color.
1 Specifying ‘--color’ and no WHEN is equivalent to ‘--color=always’.
1 If piping a colorized listing through a pager like ‘less’, use the
1 ‘-R’ option to pass the color codes to the terminal.
1
1 Note that using the ‘--color’ option may incur a noticeable
1 performance penalty when run in a directory with very many entries,
1 because the default settings require that ‘ls’ ‘stat’ every single
1 file it lists. However, if you would like most of the file-type
1 coloring but can live without the other coloring options (e.g.,
1 executable, orphan, sticky, other-writable, capability), use
1 ‘dircolors’ to set the ‘LS_COLORS’ environment variable like this,
1 eval $(dircolors -p | perl -pe \
1 's/^((CAP|S[ET]|O[TR]|M|E)\w+).*/$1 00/' | dircolors -)
1 and on a ‘dirent.d_type’-capable file system, ‘ls’ will perform
1 only one ‘stat’ call per command line argument.
1
1 ‘-F’
1 ‘--classify’
1 ‘--indicator-style=classify’
1 Append a character to each file name indicating the file type.
1 Also, for regular files that are executable, append ‘*’. The file
1 type indicators are ‘/’ for directories, ‘@’ for symbolic links,
1 ‘|’ for FIFOs, ‘=’ for sockets, ‘>’ for doors, and nothing for
1 regular files. Do not follow symbolic links listed on the command
1 line unless the ‘--dereference-command-line’ (‘-H’),
1 ‘--dereference’ (‘-L’), or
1 ‘--dereference-command-line-symlink-to-dir’ options are specified.
1
1 ‘--file-type’
1 ‘--indicator-style=file-type’
1 Append a character to each file name indicating the file type.
1 This is like ‘-F’, except that executables are not marked.
1
1 ‘--hyperlink [=WHEN]’
1 Output codes recognized by some terminals to link to files using
1 the ‘file://’ URI format. WHEN may be omitted, or one of:
1 • none - Do not use hyperlinks at all. This is the default.
1 • auto - Only use hyperlinks if standard output is a terminal.
1 • always - Always use hyperlinks.
1 Specifying ‘--hyperlink’ and no WHEN is equivalent to
1 ‘--hyperlink=always’.
1
1 ‘--indicator-style=WORD’
1 Append a character indicator with style WORD to entry names, as
1 follows:
1
1 ‘none’
1 Do not append any character indicator; this is the default.
1 ‘slash’
1 Append ‘/’ for directories. This is the same as the ‘-p’
1 option.
1 ‘file-type’
1 Append ‘/’ for directories, ‘@’ for symbolic links, ‘|’ for
1 FIFOs, ‘=’ for sockets, and nothing for regular files. This
1 is the same as the ‘--file-type’ option.
1 ‘classify’
1 Append ‘*’ for executable regular files, otherwise behave as
1 for ‘file-type’. This is the same as the ‘-F’ or ‘--classify’
1 option.
1
1 ‘-k’
1 ‘--kibibytes’
1 Set the default block size to its normal value of 1024 bytes,
1 overriding any contrary specification in environment variables
1 (⇒Block size). If ‘--block-size’, ‘-h’, ‘--human-readable’,
1 or ‘--si’ options are used, they take precedence over ‘-k’ or
1 ‘--kibibytes’ even if ‘-k’ or ‘--kibibytes’ is placed after the
1 other options.
1
1 The ‘-k’ or ‘--kibibytes’ option affects the per-directory block
1 count written by the ‘-l’ and similar options, and the size written
1 by the ‘-s’ or ‘--size’ option. It does not affect the file size
1 written by ‘-l’.
1
1 ‘-m’
1 ‘--format=commas’
1 List files horizontally, with as many as will fit on each line,
1 separated by ‘, ’ (a comma and a space).
1
1 ‘-p’
1 ‘--indicator-style=slash’
1 Append a ‘/’ to directory names.
1
1 ‘-x’
1 ‘--format=across’
1 ‘--format=horizontal’
1 List the files in columns, sorted horizontally.
1
1 ‘-T COLS’
1 ‘--tabsize=COLS’
1 Assume that each tab stop is COLS columns wide. The default is 8.
1 ‘ls’ uses tabs where possible in the output, for efficiency. If
1 COLS is zero, do not use tabs at all.
1
1 Some terminal emulators might not properly align columns to the
1 right of a TAB following a non-ASCII byte. You can avoid that
1 issue by using the ‘-T0’ option or put ‘TABSIZE=0’ in your
1 environment, to tell ‘ls’ to align using spaces, not tabs.
1
1 ‘-w COLS’
1 ‘--width=COLS’
1 Assume the screen is COLS columns wide. The default is taken from
1 the terminal settings if possible; otherwise the environment
1 variable ‘COLUMNS’ is used if it is set; otherwise the default is
1 80. With a COLS value of ‘0’, there is no limit on the length of
1 the output line, and that single output line will be delimited with
1 spaces, not tabs.
1