Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ls(I) — UNIX 6th Edition

Media Vault

Software Library

Restoration Projects

Artifacts Sought

LS(I)  −  PWB/UNIX 3/20/74

NAME

ls  −  list contents of directory

SYNOPSIS

ls [ −ltasdruifg ] 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 appropriately, but file arguments appear before directories and their contents.  There are several options:

−llist in long format, giving mode, number of links, owner, size in bytes, and time of last modification for each file.  (See below.)  If the file is a special file the size field will instead contain the major and minor device numbers. 

−tsort by time modified (latest first) instead of by name, as is normal

−alist all entries; usually those beginning with ‘.’ are suppressed

−sgive size in blocks for each entry

−dif argument is a directory, list only its name, not its contents (mostly used with −l to get status on directory)

−rreverse the order of sort to get reverse alphabetic or oldest first as appropriate

−uuse time of last access instead of last modification for sorting (−t) or printing (−l)

−iprint i-number in first column of the report for each file listed

−fforce 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. 

−gGive group ID instead of owner ID in long listing. 

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

dif the entry is a directory;

bif the entry is a block-type special file;

cif the entry is a character-type special file;

−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 characters indicate permission respectively to read, to write, or to execute the file as a program.  For a directory, ‘execute’ permission is interpreted to mean permission to search the directory for a specified file.  The permissions are indicated as follows:

rif the file is readable

wif the file is writable

xif 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 permission character is given as s if the file has set-user-ID mode.  The last character of the mode is normally blank but is printed as “t” if the 1000 bit of the mode is on. See "chmod (I)" for the current meaning of this mode. 

FILES

/etc/passwd to get user ID’s for ls −l. 

BUGS

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026