LS(I) 8/20/73 LS(I)
NAME
ls - list contents of directory
SYNOPSIS
ls [ -ltasdru ] 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:
-l list in long format, giving mode, number of links,
owner, size in bytes, and time of last modification for
each file. (See below.)
-t sort by time modified (latest first) instead of by
name, as is normal
-a list all entries; usually those beginning with `.' are
suppressed
-s give size in blocks for each entry
-d if argument is a directory, list only its name, not its
contents (mostly used with -l to get status on
directory)
-r reverse the order of sort to get reverse alphabetic or
oldest first as appropriate
-u use time of last access instead of last modification
for sorting (-t) or printing (-l)
The mode printed under the -l option contains 10 characters
which are interpreted as follows: the first character is
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;
- 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:
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
Finally, 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.
FILES
/etc/passwd to get user ID's for ls -l.
BUGS