coreutils: ls invocation
1
1 10.1 ‘ls’: List directory contents
1 ==================================
1
1 The ‘ls’ program lists information about files (of any type, including
1 directories). Options and file arguments can be intermixed arbitrarily,
1 as usual.
1
1 For non-option command-line arguments that are directories, by
1 default ‘ls’ lists the contents of directories, not recursively, and
1 omitting files with names beginning with ‘.’. For other non-option
1 arguments, by default ‘ls’ lists just the file name. If no non-option
1 argument is specified, ‘ls’ operates on the current directory, acting as
1 if it had been invoked with a single argument of ‘.’.
1
1 By default, the output is sorted alphabetically, according to the
1 locale settings in effect.(1) If standard output is a terminal, the
1 output is in columns (sorted vertically) and control characters are
1 output as question marks; otherwise, the output is listed one per line
1 and control characters are output as-is.
1
1 Because ‘ls’ is such a fundamental program, it has accumulated many
1 options over the years. They are described in the subsections below;
1 within each section, options are listed alphabetically (ignoring case).
1 The division of options into the subsections is not absolute, since some
1 options affect more than one aspect of ‘ls’’s operation.
1
1 Exit status:
1
1 0 success
1 1 minor problems (e.g., failure to access a file or directory not
1 specified as a command line argument. This happens when listing a
1 directory in which entries are actively being removed or renamed.)
1 2 serious trouble (e.g., memory exhausted, invalid option, failure
1 to access a file or directory specified as a command line argument
1 or a directory loop)
1
1 Also see ⇒Common options.
1
Menu