LS(1)                                                       LS(1)

     NAME
          ls - list files

     SYNOPSIS
          ls [ -lpqduntscr ] [ file... ]

     DESCRIPTION
          Ls lists the named files in an order and format determined
          by its options.  The options determining the output format
          are:

          -l        Produce output in long format. The information
                    given in each column is as follows:

                    1.   The permission mode of the file. This is for-
                         matted as 10 characters; the first is `d' if
                         the file is a directory, or `-' otherwise.
                         The remaining characters are in three groups
                         of three, each representing one permission
                         bit. Each character is either `r' (read per-
                         mission), `w' (write permission), `x' (exe-
                         cute permission) or `-' (no permission).  The
                         three groups represent permissions granted
                         for that file to the file's owner, members of
                         the file's group and anybody else respec-
                         tively.

                    2.   The device type (this is the `#' device let-
                         ter for local devices or `M' for files
                         mounted over a Styx connection).

                    3.   The device instance number (this distin-
                         guishes between separately mounted instances
                         of the same device).

                    4.   The file's owner.

                    5.   The file's group.

                    7.   The size of the file in bytes.

                    8.   The date and time the file was last modified
                         (see also the -u and the -e options).

                    9.   The name of the file.

          -q        Print the file's qid at the beginning of each
                    line.

          -u        Applicable only to the -l and -t options: causes

     Page 1                       Plan 9            (printed 11/18/24)

     LS(1)                                                       LS(1)

                    time-sorted listings to be listed by time of last
                    access, and the access time to be printed in
                    long-format listings instead of the modification
                    time.

          -e        Applicable only to the -l and -u options: causes
                    the time to be displayed as seconds since the
                    epoch.

          -p        Print each filename as a bare name, without the
                    name of the containing directory.

          The other options relate to the order in which the listed
          files are printed, and which files are selected. Usually,
          each file that is a directory has its contents printed. The
          -d option causes the directory itself to be listed.  In a
          union directory, it is possible for there to be two or more
          instances of a file with the same name.  The -c option
          causes only the first one occurring to be listed. The
          options relating to ordering are:

          -n        Do not sort the files at all.

          -t        Sort by modification time (most recent first) or
                    access time if the -u option is also specified.

          -s        Sort by size (smallest first).

          -r        Reverse the sort order.

     SOURCE
          /appl/cmd/ls.b

     SEE ALSO
          readdir(2), lc(1)

     Page 2                       Plan 9            (printed 11/18/24)