LS(1) DOMAIN/IX Reference Manual (SYS5) LS(1)
NAME
ls - list contents of directory
USAGE
ls [ -RadCxmlnogrtucpFbqisf ] [ names ]
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. If you specify no argument, ls lists
the current directory. If you give several arguments, ls
first sorts the arguments appropriately, but prints file
arguments before directories and their contents.
Ls can produce lists in three major formats. By default, it
lists one entry per line. It can also generate a multi-
column format, as well as stream output format in which
files are listed across the page, separated by commas.
To determine the number of character positions available on
one output line, ls uses an environment variable called
COLUMNS. If this variable is not set, the terminfo database
is used to determine the number of columns, based on the
environment variable TERM. If this information cannot be
obtained, 80 columns are assumed.
OPTIONS
-R Recursively list subdirectories encountered.
-a List all entries. Usually, entries whose names
begin with a period (.) are not listed.
-d If an argument is a directory, list only its name
(not its contents). Often used with -l to get the
status of a directory.
-C Produce multi-column output with entries sorted
down the columns.
-x Produce multi-column output with entries sorted
across rather than down the page.
-m Produce stream output format.
-l List in long format, giving mode, number of links,
owner, group, size in bytes, and time of last
modification for each file. If the file is a spe-
cial file, the size field contains the major and
minor device numbers, rather than a size. The
mode printed under the -l option consists of 10
characters, interpreted as follows:
Printed 6/10/85 LS-1
LS(1) DOMAIN/IX Reference Manual (SYS5) LS(1)
The first character is:
d directory
b block special file
c character special file
p fifo (also called a ``named pipe'') spe-
cial file
- ordinary file
The next nine characters are interpreted as 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, to write,
and to execute the file as a program, respec-
tively. For a directory, execute permission is
interpreted as permission to search the directory
for a specified file.
The permissions are indicated as follows:
r file is readable
w file is writable
x file is executable
- 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 (normally x or -) is t if the 1000
(octal) bit of the mode is on. See chmod (1) for
the meaning of this mode. The indications of
set-ID and 1000 bits of the mode are capitalized
(S and T respectively) if the corresponding exe-
cute permission is not set.
-n Same as -l, except that the owner's UID and
group's GID numbers are printed, rather than the
associated character strings.
-o Same as -l, except that the group is not printed.
-g Same as -l, except that the owner is not printed.
-r Reverse the order of sort to get reverse alpha-
betic or oldest first as appropriate.
-t Sort by time modified (latest first) instead of by
name.
-u Use time of last access instead of last modifica-
tion for sorting (with the -t option) or printing
LS-2 Printed 6/10/85
LS(1) DOMAIN/IX Reference Manual (SYS5) LS(1)
(with the -l option).
-c Use time of last modification of the i-node (file
created, mode changed, etc.) for sorting (-t) or
printing (-l).
-p Put a slash ( / ) after each filename if that file
is a directory.
-F Put a slash ( / ) after each filename if that file
is a directory and put an asterisk (*) after each
filename if that file is executable.
-b Force nongraphic characters to be printed in the
octal \ddd notation.
-q Force nongraphic characters in filenames to be
printed as question marks (?).
-i For each file, print the i-number in the first
column of the report.
-s Give size in blocks, including indirect blocks,
for each entry. Block size is considered to be
1024. Print a total count of blocks when the
sizes of the files in a directory are listed.
-f Force each argument to be interpreted as a direc-
tory and list the name found in each slot. Turn
off -l, -t, -s, and -r, and turn on -a; the order
is the order in which entries appear in the direc-
tory.
CAUTIONS
Unprintable characters in filenames may confuse the columnar
output options.
FILES
/etc/passwd to get user IDs for ls -l and ls -o
/etc/group to get group IDs for ls -l and ls -g
/usr/lib/terminfo/* to get terminal information
RELATED INFORMATION
chmod (1), find (1).
Printed 6/10/85 LS-3