]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/ls
secstore(1): add DIAGNOSTICS section
[plan9front.git] / sys / man / 1 / ls
1 .TH LS 1
2 .SH NAME
3 ls, lc \- list contents of directory
4 .SH SYNOPSIS
5 .B ls
6 [
7 .B -dlmnpqrstuFQT
8 ]
9 .I name ...
10 .PP
11 .B lc
12 [
13 .B -dlmnqrstuQT
14 ]
15 .I name ...
16 .SH DESCRIPTION
17 For each directory argument,
18 .I ls
19 lists the contents of the directory;
20 for each file argument,
21 .I ls
22 repeats its name and any other information requested.
23 When no argument is given, the current directory is listed.
24 By default, the output is sorted alphabetically by name.
25 .PP
26 .I Lc
27 is the same as
28 .IR ls ,
29 but sets the
30 .B -p
31 and
32 .B -F
33 options and pipes the output through
34 .IR mc (1).
35 .PP
36 There are a number of options:
37 .TP
38 .B  -d
39 If argument is a directory, list it, not
40 its contents.
41 .TP
42 .B  -l
43 List in long format, giving mode (see below), file system type
44 (e.g., for devices, the
45 .B #
46 code letter that names it; see
47 .IR intro (3)),
48 the instance or subdevice number, owner, group,
49 size in bytes, and time of last modification
50 for each file.
51 .TP
52 .B -m
53 List the name of the user who most recently modified the file.
54 .TP
55 .B  -n
56 Don't sort the listing.
57 .TP
58 .B  -p
59 Print only the final path element of each file name.
60 .TP
61 .B  -q
62 List the
63 .I qid
64 (see
65 .IR stat (2))
66 of each file; the printed fields are in the order
67 path, version, and type.
68 .TP
69 .B  -r
70 Reverse the order of sort.
71 .TP
72 .B  -s
73 Give size in Kbytes for each entry.
74 .TP
75 .B  -t
76 Sort by time modified (latest first) instead of
77 by name.
78 .TP
79 .B  -u
80 Under
81 .B -t
82 sort by time of last access;
83 under
84 .B -l
85 print time of last access.
86 .TP
87 .B  -F
88 Add the character
89 .B /
90 after all directory names
91 and the character
92 .B *
93 after all executable files.
94 .TP
95 .B -T
96 Print the character
97 .B t
98 before each file if it has the temporary flag set, and
99 .B -
100 otherwise.
101 .TP
102 .B -Q
103 By default, printed file names are quoted if they contain characters special to
104 .IR rc (1).
105 The
106 .B -Q
107 flag disables this behavior.
108 .PP
109 The mode printed under the
110 .B -l
111 option contains 11 characters,
112 interpreted
113 as follows:
114 the first character is
115 .TP
116 .B d
117 if the entry is a directory;
118 .TP
119 .B a
120 if the entry is an append-only file;
121 .TP
122 .B -
123 if the entry is a plain file.
124 .PD
125 .PP
126 The next letter is
127 .B l
128 if the file is exclusive access (one writer or reader at a time).
129 .PP
130 The last 9 characters are interpreted
131 as three sets of three bits each.
132 The first set refers to owner permissions;
133 the next to permissions to others in the same user-group;
134 and the last to all others.
135 Within each set the three characters indicate
136 permission respectively to read, to write, or to
137 execute the file as a program.
138 For a directory, `execute' permission is interpreted
139 to mean permission to search the directory
140 for a specified file.
141 The permissions are indicated as follows:
142 .TP 3
143 .B  r
144 if the file is readable;
145 .PD 0
146 .TP 3
147 .B  w
148 if the file is writable;
149 .TP 3
150 .B  x
151 if the file is executable;
152 .TP 3
153 .B  -
154 if none of the above permissions is granted.
155 .PD
156 .SH SOURCE
157 .B /sys/src/cmd/ls.c
158 .br
159 .B /rc/bin/lc
160 .SH SEE ALSO
161 .IR stat (2),
162 .IR mc (1)