Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ls(1) — Ultrix-32 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

ls(1)

NAME

ls − list contents of directory

SYNTAX

ls [ −acdfgilqrstuCFR ] name... 

DESCRIPTION

For each directory argument, ls lists the contents of the directory.  For each file argument, ls repeats the file name and gives any other information you request with the options available.  By default, the list is sorted alphabetically.  When no argument is given, the current directory is listed.  When several arguments are given, files are listed first, followed by directories and the files within each directory.  Options are listed below. 

OPTIONS

−1forces the output format to be one entry per line.  This is the default when output is not to a terminal. 

−alists all entries.  Without this option, names that begin with a period (.) are not listed. 

−cuses the time the file attributes were changed for sorting or printing. 

−Cforces multicolumn output.  This is the default when the output is to a terminal. 

−dlists only the directory name if an argument is a directory.  Use this option with −l to get the status of a directory. 

−flists the files within directories, in the order they appear in the directory file (see dir().)). Entries beginning with a period (.) are also listed.  This option overrides the −l, −t, −s, and −r options. 

−Fcauses directories to be marked with a trailing slash (/), sockets with a trailing equal sign (=), symbolic links with a trailing at sign (@), and executable files with a trailing asterisk (*). 

−gincludes the group ownership of the file in a long output.  To be used in conjunction with the −l option. 

−iprints the i-number for each file in the first column of the report. 

−llists the mode, number of links, owner, size in bytes, and time of last modification for each file.  If the file is a special file, the size field contains the major and minor device numbers instead of the size.  If the file is a symbolic link, the pathname of the linked-to file is printed, preceded by “−>”. 

The mode field consists of 11 characters.  The first character indicates the type of entry:

d if the entry is a directory
b if the entry is a block-type special file
c if the entry is a character-type special file
l if the entry is a symbolic link
s if the entry is a socket
− if the entry is a plain file

The next 9 characters are interpreted as three sets of three characters each.  The first set of three characters refers to file-access permissions for the user; the next set, for the user-group; and the last set, for all others.  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 the indicated permission is not granted. 

The group-execute permission character is given as s if the file has the set-group-id bit set; likewise, the user-execute permission character is given as s if the file has the set-user-id bit set. 

The last character of the mode (normally ‘x’ or ‘−’) is t if the 1000 bit of the mode is on.  See chmod() for the meaning of this mode.

−Llists the information, if the file is a symbolic link, for the file or directory the link references rather than that for the link itself. 

−qforces the printing of nongraphic characters in file names as the question mark character (?).  This is the default when output is to a terminal. 

−rreverses the order of the sort.  If used with the t option, ls lists the oldest file first.

−Rlists subdirectories recursively. 

−sgives the size in kilobytes of each file.  This is the first item listed in each entry. 

−tsorts by time modified (latest first) instead of by name. 

−uuses the time of last access instead of last modification for sorting (with the −t option) or printing (with the −l option). 

RESTRICTIONS

The output device is assumed to be 80 columns wide. 

Newline and tab are considered printing characters in file names. 

The option setting based on whether the output is a teletype is undesirable as "ls -s" is much different than "ls -s |lpr".  On the other hand, not doing this setting would make old shell scripts which used ls almost certain to fail. 

FILES

/etc/fstabUsed to obtain user id’s for ls −l

/etc/groupUsed to obtain group id’s for ls −g

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