[Top] [Prev] [Next]

ls

ls - list contents of directory

Synopsis

ls [-dlpqrstu] files...

Description

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.

Options

There are a number format/content options:
-d

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

-l

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.

-p

Print only the final path element of each file name.

-q

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.

-r

Reverse the order of sort.

-s

Sort by size.

-t

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

-u

Sort by time of last access.

The Long Format

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

The mode contains ten characters. The first character is

d

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:

r

if the file is readable;

w

if the file is writable;

x

if the file is executable;

-

if none of the above permissions is granted.

devtype

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.

uid

The user identity string.

gid

The group identity string.

size

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.

name

The file name.

Notes

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

See Also
stat

for general discussion of file attributes

Inferno Devices

for discussion of device type

stat

for definition of modification time



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.