man(1) Manual page archive


     LS(1)                                                       LS(1)

     NAME
          ls, lc - list contents of directory

     SYNOPSIS
          ls [ -acdfilrstuFLR ] name ...

          lc [ options ] name ...

     DESCRIPTION
          For each directory argument, ls lists the contents of the
          directory; for each file argument, ls repeats its name and
          any other information requested.  The output is sorted
          alphabetically by default.  When no argument is given, the
          current directory is listed.  When several arguments are
          given, the arguments are first sorted, but file arguments
          appear before directories and their contents.

          Lc is the same as ls, but prints the list in multiple
          columns.

          There are an unbelievable number of options:

          -l   List in long format, giving mode (see below), number of
               links, owner, group, size in bytes, and time of last
               modification for each file.  Symbolic links are identi-
               fied by a link count marked `L'; the link count is that
               of the ultimate file.  If the file is a special file
               the size field will instead contain the major and minor
               device numbers.

          -d   If argument is a directory, list its name, not its con-
               tents.

          -t   Sort by time modified (latest first) instead of by
               name, as is normal.

          -L   Under -l for each symbolic link give the immediate, not
               the ultimate, link count and append the name pointed
               to.

          -a   List all entries; usually and are suppressed.

          -c   Under -t sort by time of inode change; under -l print
               time of inode change.

          -f   Force each argument to be interpreted as a directory
               and list the name found in each slot.  This option
               turns off -l, -t, -s, and -r, and turns on -a; the
               order is the order in which entries appear in the
               directory.

     LS(1)                                                       LS(1)

          -F   Mark directories with a trailing `/' and executable
               files with a trailing `*'

          -i   Print i-number in first column of the report for each
               file listed.

          -r   Reverse the order of sort to get reverse alphabetic or
               oldest first as appropriate.

          -R   recursively list subdirectories encountered.

          -s   Give size in Kbytes for each entry.

          -u   Under -t sort by time of last access; under -l print
               time of last access.

          The mode printed under the -l option contains 11 characters
          which are interpreted as follows: the first character is

          d    if the entry is a directory;
          b    if the entry is a block-type special file;
          c    if the entry is a character-type special file;
          l    if the entry is a symbolic link and option -L is in
               effect;
          -    if the entry is a plain file.

          The next 9 characters are interpreted as three sets of three
          bits each.  The first set refers to owner permissions; the
          next to permissions to others in the same user-group; and
          the last to all others.  Within each set the three charac-
          ters indicate permission respectively to read, to write, or
          to execute the file as a program.  For a directory, `exe-
          cute' permission is interpreted to mean permission to search
          the directory for a specified file.  The permissions are
          indicated as follows:

          r  if the file is readable;
          w  if the file is writable;
          x  if the file is executable;
          -  if the indicated permission is not granted.

          The group-execute permission character is given as s if the
          file has set-group-ID mode; likewise the user-execute per-
          mission character is given as s if the file has set-user-ID
          mode.

          The last character of the mode (normally a blank) indicates
          the type of concurrency control:

          e    if the file is set for exclusive access (1 writer or n
               readers);
          y    if the file is set for synchronized access (1 writer

     LS(1)                                                       LS(1)

               and n readers);

     FILES
     SEE ALSO
          stat(2)

     BUGS
          Option -s counts unwritten holes as if they were real data.