[manual index][section index]


ls, lc - list files


ls [ -lpmnqduntscrFT ] [ file... ]

lc [ -lpmnqduntscrFT ] [ file... ]


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

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

The permission mode of the file. This is formatted as 11 characters; the first is `d' if the file is a directory, `a' if the file is append-only, `A' if it is an authentication file, or `-' otherwise. The next character is `l' if the file is exclusive-use, or `-' otherwise. The remaining characters are in three groups of three, each representing one permission bit. Each character is either `r' (read permission), `w' (write permission), `x' (execute 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 respectively.

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

The device instance number (this distinguishes between separately mounted instances of the same device).

The file's owner.

The file's group.

The size of the file in bytes.

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

The name of the file.
Print the name of the user who most recently modified the file.
Print the file's qid (see sys-stat(2)) at the beginning of each line; the printed fields are in the order path, version, and type.
Applicable only to the -l and -t options: causes 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.
Applicable only to the -l and -u options: causes the time to be displayed as seconds since the epoch.
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:

Do not sort the files at all.
Sort by modification time (most recent first) or access time if the -u option is also specified.
Sort by size (smallest first).
Reverse the sort order.
Add the character / after all directory names and the character * after all executable files.
Print the character t before each file if it has the temporary flag set, and - otherwise.

Lc is the same as ls, but sets the -p option and pipes the output through mc(1).




readdir(2), mc(1)

LS(1 ) Rev:  Tue Jun 05 22:51:35 GMT 2007