1 | .TH LS 1
|
---|
2 | .SH NAME
|
---|
3 | ls \- list the contents of a directory
|
---|
4 | .SH SYNOPSIS
|
---|
5 | \fBls\fP [\fB\-acdfghilpqrstu1ACDFLMRTX\fP] [\fIname\fP...]
|
---|
6 | .SH DESCRIPTION
|
---|
7 | For each file argument, list it. For each directory argument, list its
|
---|
8 | contents. The current working directory is listed when no files are named.
|
---|
9 | Information is printed multicolumn on terminals, single column if the output
|
---|
10 | is redirected. The options control what information is shown and how.
|
---|
11 | .PP
|
---|
12 | .B Ls
|
---|
13 | has two sources other then the command line to draw options from, one is
|
---|
14 | the environment variable
|
---|
15 | .B LSOPTS
|
---|
16 | that is scanned for option letters when the output of
|
---|
17 | .B ls
|
---|
18 | is displayed on a terminal. The other is the name of
|
---|
19 | .B ls
|
---|
20 | itself. If
|
---|
21 | .B ls
|
---|
22 | is linked to another name, then all the characters after the l are used as
|
---|
23 | flags too, except that d, f, r, t and x are translated to D, F, R, T and X.
|
---|
24 | Useful links are
|
---|
25 | .BR ll ,
|
---|
26 | .BR lf ,
|
---|
27 | .B lm
|
---|
28 | and
|
---|
29 | .BR lx .
|
---|
30 | .PP
|
---|
31 | Files whose names start with a dot are by default not listed.
|
---|
32 | .PP
|
---|
33 | Note that standard MINIX 3 doesn't have symbolic links or sockets and
|
---|
34 | .B \-u
|
---|
35 | and
|
---|
36 | .B \-c
|
---|
37 | are no-ops on a V1 file system, since only modified times are stored in V1
|
---|
38 | inodes.
|
---|
39 | .SH OPTIONS
|
---|
40 | .TP
|
---|
41 | .B \-a
|
---|
42 | All entries are listed, even
|
---|
43 | .B .
|
---|
44 | and
|
---|
45 | .B ..
|
---|
46 | .TP
|
---|
47 | .B \-c
|
---|
48 | Use inode changed time for sorting, listing or searching.
|
---|
49 | .TP
|
---|
50 | .B \-d
|
---|
51 | Do not list contents of directories, but list the directory itself.
|
---|
52 | .TP
|
---|
53 | .B \-f
|
---|
54 | Do not sort (should also be: treat a file as a directory, but that
|
---|
55 | can't be implemented portably).
|
---|
56 | .TP
|
---|
57 | .B \-g
|
---|
58 | Suppress the owner name on a long listing (implies
|
---|
59 | .BR \-l ).
|
---|
60 | .TP
|
---|
61 | .B \-h
|
---|
62 | Show file sizes in kilo, mega or gigabytes.
|
---|
63 | .TP
|
---|
64 | .B \-i
|
---|
65 | I-node number printed in the first column.
|
---|
66 | .TP
|
---|
67 | .B \-l
|
---|
68 | Long listing: mode, links, owner, group, size and time.
|
---|
69 | .RB ( "ls \-lC"
|
---|
70 | uses columns in a wide enough window!)
|
---|
71 | .TP
|
---|
72 | .B \-n
|
---|
73 | Print numerical user and group id's.
|
---|
74 | .TP
|
---|
75 | .B \-p
|
---|
76 | Mark directories with a '\fB/\fP'.
|
---|
77 | .TP
|
---|
78 | .B \-q
|
---|
79 | Print nongraphic characters as '\fB?\fP' (default on terminals).
|
---|
80 | .TP
|
---|
81 | .B \-r
|
---|
82 | Reverse the sort order.
|
---|
83 | .TP
|
---|
84 | .B \-s
|
---|
85 | Give the size in kilobytes in the first
|
---|
86 | .RB ( \-s )
|
---|
87 | or second column
|
---|
88 | .RB ( \-is ).
|
---|
89 | .TP
|
---|
90 | .B \-t
|
---|
91 | Sort by time (modified time default), latest first.
|
---|
92 | .TP
|
---|
93 | .B \-u
|
---|
94 | Use last accessed time for sorting, listing or searching.
|
---|
95 | .TP
|
---|
96 | .B \-1
|
---|
97 | Print in one column.
|
---|
98 | .TP
|
---|
99 | .B \-A
|
---|
100 | List all entries, but not
|
---|
101 | .B .
|
---|
102 | and
|
---|
103 | .B ..
|
---|
104 | (This is the default for privileged users.)
|
---|
105 | .TP
|
---|
106 | .B \-C
|
---|
107 | Print multicolumn (default on terminals).
|
---|
108 | .TP
|
---|
109 | .B \-D
|
---|
110 | Distinguish files by type, i.e. regular files together, directories
|
---|
111 | together, etc.
|
---|
112 | .TP
|
---|
113 | .B \-F
|
---|
114 | Mark directories with a '\fB/\fP', executables with a '\fB*\fP', \s-2UNIX\s+2
|
---|
115 | domain sockets with a '\fB=\fP', named pipes with a '\fB|\fP' and symbolic
|
---|
116 | links with a '\fB@\fP' behind the name.
|
---|
117 | .TP
|
---|
118 | .B \-L
|
---|
119 | Print the file referenced by a symbolic link instead of the link.
|
---|
120 | .TP
|
---|
121 | .B \-M
|
---|
122 | List mode before name (implies
|
---|
123 | .BR \-C ).
|
---|
124 | .TP
|
---|
125 | .B \-R
|
---|
126 | List directory trees recursively.
|
---|
127 | .TP
|
---|
128 | .B \-T
|
---|
129 | Print file times in a long format, e.g. "Oct 24 21:37:41 1996".
|
---|
130 | .TP
|
---|
131 | .B \-X
|
---|
132 | Print crunched mode and size before name (implies
|
---|
133 | .BR \-C ).
|
---|
134 | Only the rwx permissions that its caller has on the file are shown, but they
|
---|
135 | are in upper case if the caller owns the file and has given the permission
|
---|
136 | to the callers group or other users. The size is listed in bytes (<= 5K),
|
---|
137 | or rounded up kilo, mega or gigabytes.
|
---|
138 | .SH "SEE ALSO"
|
---|
139 | .BR du (1),
|
---|
140 | .BR stat (1),
|
---|
141 | .BR stat (2).
|
---|
142 | .SH BUGS
|
---|
143 | Having to type
|
---|
144 | .B ls \-C
|
---|
145 | when viewing files through
|
---|
146 | .BR more (1).
|
---|
147 | .PP
|
---|
148 | Is only portable to systems with the same
|
---|
149 | .B st_mode
|
---|
150 | (see
|
---|
151 | .BR stat (2)).
|
---|
152 | .PP
|
---|
153 | The
|
---|
154 | .B LSOPTS
|
---|
155 | variable and the
|
---|
156 | .BR -D ,
|
---|
157 | .B -M
|
---|
158 | and
|
---|
159 | .B -X
|
---|
160 | flags are not found on other
|
---|
161 | .B ls
|
---|
162 | implementations. (They have their own nonstandard flags.)
|
---|
163 | .SH AUTHOR
|
---|
164 | Kees J. Bot <kjb@cs.vu.nl>
|
---|