[Top] [Prev] [Next]


ls - list contents of directory


ls [-dlpqrstu] files...


For each directory argument, ls lists (to standard output) the contents of the directory; for each file argument, ls repeats its name and any other information requested. When no argument is given, the current directory is listed.


There are a number format/content options:

If argument is a directory, list it, not its contents.


List in long format, giving mode (see below), file system type (e.g., for devices, the # code letter that names it; see Inferno Devices), the instance or subdevice number, owner, group, size in bytes, and time of last modification for each file.


Print only the final path element of each file name.


Include the qid (see stat) of each file. By default, the output is sorted alphabetically by name; however, there are a number of sorting options.


Reverse the order of sort.


Sort by size.


Sort by time modified (latest first) instead of by name.


Sort by time of last access.

The Long Format

The information given under the -l format consists of eight fields:

The mode contains ten characters. The first character is


if the entry is a directory;


if the entry is a plain file.

The remaining nine characters are interpreted as three sets of three bits each. The first set refers to owner (uid) permissions; the next to permissions to others in the same user-group (gid); and the last to all others.

Within each set the three characters indicate permission respectively to read, to write, or to execute the file as a program.

For a directory, `execute' permission means permission to search the directory for a specified file.

The permissions are indicated as follows:


if the file is readable;


if the file is writable;


if the file is executable;


if none of the above permissions is granted.


The device type for the file, a single character representing the root of a file tree implemented by a particular kernel device driver.

device number

A number provided by the file system server.


The user identity string.


The group identity string.


The size of the file in bytes.

modification time

The modification time of the file formatted per Daytime->filet: files less than 6 months old appear with month, day-of-month, and time-of-day; files over 6 months old show appear with month, day-of-month, and year.


The file name.


The sorting options correspond to the sortkey options of the readdir module. See readdir.

See Also

for general discussion of file attributes

Inferno Devices

for discussion of device type


for definition of modification time

[Top] [Prev] [Next]

Copyright © 1996,Lucent Technologies, Inc. All rights reserved.