Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ls.bsd(1) — Domain/IX SR9.2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

LS(1)

NAME

ls − list contents of directory

USAGE

ls [ options ] 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.  By default, it sorts the output alphabetically.  When no argument is given, it lists the current directory.  When several arguments are given, ls lists the arguments appropriately, but processes file arguments before directories and their contents. 

OPTIONS

−l List in long format, giving mode, number of links, owner, size in bytes (total count of blocks, including indirect blocks), 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 total number of blocks.  If the file is a symbolic link, the pathname of the linked-to file is printed (preceded by −> characters).  The mode printed under this option consists of 11 characters.  The interpretation of these characters follows: The first character is d (directory), b (block-type special file), c (character special file), l (symbolic link), s (socket), or − (ordinary file).  The next nine characters are three sets of three bits each. The first set refers to the owner’s permissions; the next to permissions of others in the user group of the file; and the last to all others. Within each set, the three characters indicate permission to read (designated as r), to write (designated as w), and to execute (designated as x) the file as a program. Execute permission in a directory allows you to search that directory for a specified file. A dash (−) indicates that no permissions are 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 (normally x or −) is t if the 1000 (octal) bit of the mode is on.  See chmod (1) for the meaning of this mode. 

−g Include the group ownership of the file in a long output. 

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

−a List all entries.  Without this option, ls does not list entries whose names begin with a period. 

−A Same as −a, but skip entries beginning with a single period or double periods. 

−s Give size, in kilobytes, of each file.  This includes a total count of all blocks, including those that are indirect. 

−d If argument is a directory, list only its name.  This option is often used with −l to get the status of a directory. 

−L If argument is a symbolic link, list the file or directory the link references rather than the link itself. 

−r Reverse the order of sort to get reverse alphabetic or oldest first as appropriate. 

−u Use the time last accessed instead of the time last modified for sorting (with the −t option) and/or printing (with the −l option). 

−c Use the time of file creation for sorting or printing. 

−i For each file, print the i-number in the first column of the report. 

−f Force 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 it uses is the order in which entries appear in the directory. 

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

−R Recursively list all subdirectories encountered. 

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

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

−q Force printing of nongraphic characters in filenames as a question mark (?).  This is the default when the output is to a terminal. 

CAUTIONS

Newline and tab are considered printing characters in filenames. 

The output device is assumed to be 80 columns wide. 

FILES

/etc/passwd
to get user IDs for ls −l

/etc/group
to get group IDs for ls −g

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