Research V4 development
[unix-history] / man / man1 / ls.1
CommitLineData
31fa6cad
DR
1.th LS I 8/20/73
2.sh NAME
3ls \*- list contents of directory
4.sh SYNOPSIS
5.bd ls
6[
7.bd \*-ltasdru
8] name ...
9.sh DESCRIPTION
10For each directory argument,
11.it ls
12lists the contents of the directory;
13for each file argument,
14.it ls
15repeats its name and any other information requested.
16The output is sorted alphabetically by default.
17When no argument is given, the current directory is listed.
18When several arguments are given,
19the arguments are first sorted appropriately,
20but file arguments appear
21before directories and their contents.
22There are several options:
23.s3
24.lp +4 4
25\fB\*-l\fR list in long format, giving mode, number of links, owner,
26size in bytes, and time of last modification
27for each file.
28(See below.)
29.s3
30.lp +4 4
31\fB\*-t\fR sort by time modified (latest first) instead of
32by name, as is normal
33.s3
34.lp +4 4
35\fB\*-a\fR list all entries; usually those beginning with `\fB.\fR' are
36suppressed
37.s3
38.lp +4 4
39\fB\*-s\fR give size in blocks for each entry
40.s3
41.lp +4 4
42\fB\*-d\fR if argument is a directory, list only its name, not
43its contents (mostly used with
44.bd \*-l
45to get status
46on directory)
47.s3
48.lp +4 4
49\fB\*-r\fR reverse the order of sort to get reverse alphabetic
50or oldest first as appropriate
51.s3
52.lp +4 4
53\fB\*-u\fR use time of last access instead of last
54modification for sorting (\fB\*-t\fR) or printing
55(\fB\*-l\fR)
56.s3
57.i0
58The mode printed under the
59.bd \*-l
60option contains 10 characters
61which are interpreted
62as follows:
63the first character is
64.s3
65.lp +3 3
66\fBd\fR if the entry is a directory;
67.lp +3 3
68\fBb\fR if the entry is a block-type special file;
69.lp +3 3
70\fBc\fR if the entry is a character-type special file;
71.lp +3 3
72\fB\*-\fR if the entry is a plain file.
73.s3
74.i0
75The next 9 characters are interpreted
76as three sets of three bits each.
77The first set refers to owner permissions;
78the next to permissions to others in the same user-group;
79and the last to all others.
80Within each set the three characters indicate
81permission respectively to read, to write, or to
82execute the file as a program.
83For a directory, `execute' permission is interpreted
84to mean permission to search the directory
85for a specified file.
86The permissions are indicated as follows:
87.s3
88.lp +3 3
89\fBr\fR if the file is readable
90.lp +3 3
91\fBw\fR if the file is writable
92.lp +3 3
93\fBx\fR if the file is executable
94.lp +3 3
95\fB\*-\fR if the indicated permission is not granted
96.s3
97.i0
98Finally, the group-execute permission character is given
99as
100.bd s
101if the file has set-group-ID mode;
102likewise the user-execute permission character is given
103as
104.bd s
105if the file has set-user-ID mode.
106.sh FILES
107/etc/passwd to get user ID's for
108\fBls \*-l\fR.
109.sh BUGS