672 xargs doesn't support -0
[illumos-gate.git] / usr / src / man / man1 / ls.1
blob8327abc700c167cc128d1718fe7f81ac54c5e036
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
4 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
7 .\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
8 .\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
9 .\"  This notice shall appear on any product containing this material.
10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
11 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
12 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
13 .TH LS 1 "Jun 3, 2009"
14 .SH NAME
15 ls \- list contents of directory
16 .SH SYNOPSIS
17 .LP
18 .nf
19 \fB/usr/bin/ls\fR [\fB-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@\fR]
20      [\fB-/ c\fR | \fBv\fR] [\fB-% atime | crtime | ctime | mtime | all\fR]
21      [--block-size size] [--color[=\fIwhen\fR]] [--file-type]
22      [--si] [--time-style \fIstyle\fR] [\fIfile\fR]...
23 .fi
25 .LP
26 .nf
27 \fB/usr/xpg4/bin/ls\fR [\fB-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@\fR]
28      [\fB-/ c\fR | \fBv\fR] [\fB-% atime | crtime | ctime | mtime | all\fR]
29      [--block-size size] [--color[=\fIwhen\fR]] [--file-type]
30      [--si] [--time-style \fIstyle\fR] [\fIfile\fR]...
31 .fi
33 .LP
34 .nf
35 \fB/usr/xpg6/bin/ls\fR [\fB-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@\fR]
36      [\fB-/ c\fR | \fBv\fR] [\fB-% atime | crtime | ctime | mtime | all\fR]
37      [--block-size size] [--color[=\fIwhen\fR]] [--file-type]
38      [--si] [--time-style \fIstyle\fR] [\fIfile\fR]...
39 .fi
41 .SH DESCRIPTION
42 .sp
43 .LP
44 For each \fIfile\fR that is a directory, \fBls\fR lists the contents of the
45 directory. For each \fIfile\fR that is an ordinary file, \fBls\fR repeats its
46 name and any other information requested. The output is sorted alphabetically
47 by default. When no argument is given, the current directory (\fB\&.\fR) is
48 listed. When several arguments are given, the arguments are first sorted
49 appropriately, but file arguments appear before directories and their contents.
50 .sp
51 .LP
52 There are three major listing formats. The default format for output directed
53 to a terminal is multi\(micolumn with entries sorted down the columns. The
54 \fB-1\fR option allows single column output and \fB-m\fR enables stream output
55 format. In order to determine output formats for the \fB-C\fR, \fB-x\fR, and
56 \fB-m\fR options, \fBls\fR uses an environment variable, \fBCOLUMNS\fR, to
57 determine the number of character positions available on one output line. If
58 this variable is not set, the \fBterminfo\fR(4) database is used to determine
59 the number of columns, based on the environment variable, \fBTERM\fR. If this
60 information cannot be obtained, 80 columns are assumed. If the \fB-w\fR option
61 is used, the argument overrides any other column width.
62 .sp
63 .LP
64 The mode printed when the \fB-e\fR, \fB-E\fR, \fB-g\fR, \fB-l\fR, \fB-n\fR,
65 \fB-o\fR, \fB-v\fR, \fB-V\fR, or \fB-@\fR option is in effect consists of
66 eleven characters. The first character can be one of the following:
67 .sp
68 .ne 2
69 .na
70 \fB\fBd\fR\fR
71 .ad
72 .sp .6
73 .RS 4n
74 The entry is a directory.
75 .RE
77 .sp
78 .ne 2
79 .na
80 \fB\fBD\fR\fR
81 .ad
82 .sp .6
83 .RS 4n
84 The entry is a door.
85 .RE
87 .sp
88 .ne 2
89 .na
90 \fB\fBl\fR\fR
91 .ad
92 .sp .6
93 .RS 4n
94 The entry is a symbolic link.
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fB\fBb\fR\fR
102 .sp .6
103 .RS 4n
104 The entry is a block special file.
108 .ne 2
110 \fB\fBc\fR\fR
112 .sp .6
113 .RS 4n
114 The entry is a character special file.
118 .ne 2
120 \fB\fBp\fR\fR
122 .sp .6
123 .RS 4n
124 The entry is a \fBFIFO\fR (or "named pipe") special file.
128 .ne 2
130 \fB\fBP\fR\fR
132 .sp .6
133 .RS 4n
134 The entry is an event port.
138 .ne 2
140 \fB\fBs\fR\fR
142 .sp .6
143 .RS 4n
144 The entry is an \fBAF_UNIX\fR address family socket.
148 .ne 2
150 \fB\fB\(mi\fR\fR
152 .sp .6
153 .RS 4n
154 The entry is an ordinary file.
159 The next 9 characters are interpreted as three sets of three bits each. The
160 first set refers to the owner's permissions; the next to permissions of others
161 in the user-group of the file; and the last to all others. Within each set, the
162 three characters indicate permission to read, to write, and to execute the file
163 as a program, respectively. For a directory, \fBexecute\fR permission is
164 interpreted to mean permission to search the directory for a specified file.
165 The character after permissions is an ACL or extended attributes indicator.
166 This character is an \fB@\fR if extended attributes are associated with the
167 file and the \fB-@\fR option is in effect. Otherwise, this character is a plus
168 sign (\fB+\fR) character if a non-trivial ACL is associated with the file or a
169 space character if not.
172 If \fB-/\fR and/or \fB-%\fR are in effect, then the extended system attributes
173 are printed when filesystem supports extended system attributes. The display
174 looks as follows:
176 .in +2
178 $ls -/ c  file
179 -rw-r--r--   1 root     root           0 May 10 14:17 file
180                 {AHRSadim-u}
182 $ls -/ v file
183 -rw-r--r--   1 root     root           0 May 10 14:17 file
184                 {archive,hidden,readonly,system,appendonly\e
185                  nodump,immutable, av_modified,\e
186                  noav_quarantined,nounlink}
188 $ls -l -% all file
189 -rw-r--r--   1 root     root           0 May 10 14:17 file
190                 timestamp: atime    Jun 25 12:56:44 2007
191                 timestamp: ctime    May 10 14:20:23 2007
192                 timestamp: mtime    May 10 14:17:56 2007
193                 timestamp: crtime   May 10 14:17:56 2007
195 .in -2
200 See the option descriptions of the \fB-/\fR and \fB-%\fR option for details.
203 \fBls\fR \fB-l\fR (the long list) prints its output as follows for the POSIX
204 locale:
206 .in +2
208 -rwxrwxrwx+ 1 smith dev   10876  May 16 9:42 part2
210 .in -2
215 Reading from right to left, you see that the current directory holds one file,
216 named \fBpart2\fR. Next, the last time that file's contents were modified was
217 \fB9:42 A.M.\fR on \fBMay 16\fR. The file contains 10,876 characters, or bytes.
218 The owner of the file, or the user, belongs to the group \fBdev\fR (perhaps
219 indicating \fBdevelopment\fR), and his or her login name is \fBsmith\fR. The
220 number, in this case \fB1\fR, indicates the number of links to file \fBpart2\fR
221 (see \fBcp\fR(1)). The plus sign indicates that there is an \fBACL\fR
222 associated with the file. If the \fB-@\fR option has been specified, the
223 presence of extended attributes supersede the presence of an \fBACL\fR and the
224 plus sign is replaced with an 'at' sign (\fB@\fR). Finally, the dash and
225 letters tell you that user, group, and others have permissions to read, write,
226 and execute \fBpart2\fR.
229 The execute (\fBx\fR) symbol occupies the third position of the three-character
230 sequence. A \fB\(mi\fR in the third position would have indicated a denial of
231 execution permissions.
234 The permissions are indicated as follows:
236 .ne 2
238 \fB\fBr\fR\fR
240 .sp .6
241 .RS 4n
242 The file is readable.
246 .ne 2
248 \fB\fBw\fR\fR
250 .sp .6
251 .RS 4n
252 The file is writable.
256 .ne 2
258 \fB\fBx\fR\fR
260 .sp .6
261 .RS 4n
262 The file is executable.
266 .ne 2
268 \fB\fB\(mi\fR\fR
270 .sp .6
271 .RS 4n
272 The indicated permission is \fInot\fR granted.
276 .ne 2
278 \fB\fBs\fR\fR
280 .sp .6
281 .RS 4n
282 The \fBs\fRet-user-ID or \fBs\fRet-group-ID bit is on, and the corresponding
283 user or group execution bit is also on.
287 .ne 2
289 \fB\fBS\fR\fR
291 .sp .6
292 .RS 4n
293 Undefined bit-state (the set-user-ID or set-group-id bit is on and the user or
294 group execution bit is off). For group permissions, this applies only to
295 non-regular files.
299 .ne 2
301 \fB\fBt\fR\fR
303 .sp .6
304 .RS 4n
305 The 1000 (octal) bit, or sticky bit, is on (see \fBchmod\fR(1)), and execution
306 is on.
310 .ne 2
312 \fB\fBT\fR\fR
314 .sp .6
315 .RS 4n
316 The 1000 bit is turned on, and execution is off (undefined bit-state).
319 .SS "/usr/bin/ls"
321 .ne 2
323 \fB\fBl\fR\fR
325 .sp .6
326 .RS 4n
327 Mandatory locking occurs during access (on a regular file, the set-group-ID bit
328 is on and the group execution bit is off).
331 .SS "/usr/xpg4/bin/ls and /usr/xpg6/bin/ls"
333 .ne 2
335 \fB\fBL\fR\fR
337 .sp .6
338 .RS 4n
339 Mandatory locking occurs during access (on a regular file, the set-group-ID bit
340 is on and the group execution bit is off).
345 For user and group permissions, the third position is sometimes occupied by a
346 character other than \fBx\fR or \fB-\fR. \fBs\fR or \fBS\fR also can occupy
347 this position, referring to the state of the set-ID bit, whether it be the
348 user's or the group's. The ability to assume the same ID as the user during
349 execution is, for example, used during login when you begin as root but need to
350 assume the identity of the user you login as.
353 In the case of the sequence of group permissions, \fBl\fR can occupy the third
354 position. \fBl\fR refers to mandatory file and record locking. This permission
355 describes a file's ability to allow other files to lock its reading or writing
356 permissions during access.
359 For others permissions, the third position can be occupied by \fBt\fR or
360 \fBT\fR. These refer to the state of the sticky bit and execution permissions.
361 .SS "Color Output"
364 If color output is enabled, the environment variable LS_COLORS is checked.  If
365 it exists, it's contents are used to control the colors used to display
366 filenames.  If it is not set, a default list of colors is used. The format of
367 LS_COLORS is a colon separated list of attribute specifications. Each attribute
368 specification is of the format
370 .in +2
372 \fIfilespec\fR=\fIattr\fR[;\fIattr\fR..]
374 .in -2
379 \fIfilespec\fR is either of the form \fI*.SUFFIX\fR, for example, \fB*.jar\fR
380 or \fB*.Z\fR, or one of the following file types:
382 .ne 2
384 \fB\fBno\fR\fR
386 .sp .6
387 .RS 4n
388 Normal file
392 .ne 2
394 \fB\fBfi\fR\fR
396 .sp .6
397 .RS 4n
398 Regular file
402 .ne 2
404 \fB\fBdi\fR\fR
406 .sp .6
407 .RS 4n
408 Directory
412 .ne 2
414 \fB\fBln\fR\fR
416 .sp .6
417 .RS 4n
418 Symbolic link
422 .ne 2
424 \fB\fBpi\fR\fR
426 .sp .6
427 .RS 4n
428 FIFO or named pipe
432 .ne 2
434 \fB\fBso\fR\fR
436 .sp .6
437 .RS 4n
438 Socket
442 .ne 2
444 \fB\fBdo\fR\fR
446 .sp .6
447 .RS 4n
448 Door file
452 .ne 2
454 \fB\fBbd\fR\fR
456 .sp .6
457 .RS 4n
458 Block device
462 .ne 2
464 \fB\fBcd\fR\fR
466 .sp .6
467 .RS 4n
468 Character device
472 .ne 2
474 \fB\fBex\fR\fR
476 .sp .6
477 .RS 4n
478 Execute bit (either \fBuser\fR, \fBgroup\fR, or \fBother\fR) set
482 .ne 2
484 \fB\fBpo\fR\fR
486 .sp .6
487 .RS 4n
488 Event port
492 .ne 2
494 \fB\fBst\fR\fR
496 .sp .6
497 .RS 4n
498 Sticky bit set
502 .ne 2
504 \fB\fBor\fR\fR
506 .sp .6
507 .RS 4n
508 Orphaned symlink
512 .ne 2
514 \fB\fBsg\fR\fR
516 .sp .6
517 .RS 4n
518 \fBsetgid\fR binary
522 .ne 2
524 \fB\fBsu\fR\fR
526 .sp .6
527 .RS 4n
528 \fBsetuid\fR binary
532 .ne 2
534 \fB\fBow\fR\fR
536 .sp .6
537 .RS 4n
538 \fBworld\fR writable
542 .ne 2
544 \fB\fBtw\fR\fR
546 .sp .6
547 .RS 4n
548 Sticky bit and \fBworld\fR writable
553 \fIattr\fR is a semicolon delimited list of color and display attributes which
554 are combined to determine the final output color. Any combination of \fIattr\fR
555 values can be specified. Possible \fIattr\fR values are:
557 .ne 2
559 \fB\fB00\fR\fR
561 .sp .6
562 .RS 4n
563 All attributes off (default terminal color)
567 .ne 2
569 \fB\fB01\fR\fR
571 .sp .6
572 .RS 4n
573 Display text in bold
577 .ne 2
579 \fB\fB04\fR\fR
581 .sp .6
582 .RS 4n
583 Display text with an underscore
587 .ne 2
589 \fB\fB05\fR\fR
591 .sp .6
592 .RS 4n
593 Display text in bold
597 .ne 2
599 \fB\fB07\fR\fR
601 .sp .6
602 .RS 4n
603 Display text with foreground and background colors reversed
607 .ne 2
609 \fB\fB08\fR\fR
611 .sp .6
612 .RS 4n
613 Display using concealed text.
618 One of the following values can be chosen. If multiple values are specified,
619 the last specified value is used.
621 .ne 2
623 \fB\fB30\fR\fR
625 .sp .6
626 .RS 4n
627 Set foreground to \fBblack\fR.
631 .ne 2
633 \fB\fB31\fR\fR
635 .sp .6
636 .RS 4n
637 Set foreground to \fBred\fR.
641 .ne 2
643 \fB\fB32\fR\fR
645 .sp .6
646 .RS 4n
647 Set foreground to \fBgreen\fR.
651 .ne 2
653 \fB\fB33\fR\fR
655 .sp .6
656 .RS 4n
657 Set foreground to \fByellow\fR.
661 .ne 2
663 \fB\fB34\fR\fR
665 .sp .6
666 .RS 4n
667 Set foreground to \fBblue\fR.
671 .ne 2
673 \fB\fB35\fR\fR
675 .sp .6
676 .RS 4n
677 Set foreground to \fBmagenta\fR (\fBpurple\fR).
679 Set foreground to \fB\fR.
683 .ne 2
685 \fB\fB36\fR\fR
687 .sp .6
688 .RS 4n
689 Set foreground to \fBcyan\fR.
693 .ne 2
695 \fB\fB37\fR\fR
697 .sp .6
698 .RS 4n
699 Set foreground to \fBwhite\fR.
703 .ne 2
705 \fB\fB39\fR\fR
707 .sp .6
708 .RS 4n
709 Set foreground to default terminal color.
714 One of the following can be specified. If multiple values are specified, the
715 last value specified is used.
717 .ne 2
719 \fB\fB40\fR\fR
721 .sp .6
722 .RS 4n
723 Set foreground to \fBblack\fR.
727 .ne 2
729 \fB\fB41\fR\fR
731 .sp .6
732 .RS 4n
733 Set foreground to \fBred\fR.
737 .ne 2
739 \fB\fB42\fR\fR
741 .sp .6
742 .RS 4n
743 Set foreground to \fBgreen\fR.
747 .ne 2
749 \fB\fB43\fR\fR
751 .sp .6
752 .RS 4n
753 Set foreground to \fByellow\fR.
757 .ne 2
759 \fB\fB44\fR\fR
761 .sp .6
762 .RS 4n
763 Set foreground to \fBblue\fR.
767 .ne 2
769 \fB\fB45\fR\fR
771 .sp .6
772 .RS 4n
773 Set foreground to \fBmagenta\fR (\fBpurple\fR).
777 .ne 2
779 \fB\fB46\fR\fR
781 .sp .6
782 .RS 4n
783 Set foreground to \fBcyan\fR.
787 .ne 2
789 \fB\fB47\fR\fR
791 .sp .6
792 .RS 4n
793 Set foreground to \fBwhite\fR.
797 .ne 2
799 \fB\fB49\fR\fR
801 .sp .6
802 .RS 4n
803 Set foreground to default terminal color.
808 On some terminals, setting the bold attribute causes the foreground colors to
809 be high-intensity, that is, brighter. In such cases the low-intensity yellow is
810 often displayed as a brown or orange color.
813 At least one attribute must be listed for a file specification.
816 The appropriate color codes are chosen by selecting the most specific match,
817 starting with the file suffixes and proceeding with the file types until a
818 match is found. The \fBno\fR (normal file) type matches any file.
819 .SH OPTIONS
822 The following options are supported:
823 .SS "/usr/bin/ls, /usr/xpg4/bin/ls, and /usr/xpg6/bin/ls"
826 The following options are supported for all three versions:
828 .ne 2
830 \fB\fB-a\fR\fR
834 \fB\fB--all\fR\fR
836 .sp .6
837 .RS 4n
838 Lists all entries, including those that begin with a dot (\fB\&.\fR), which are
839 normally not listed.
843 .ne 2
845 \fB\fB-A\fR\fR
849 \fB\fB--almost-all\fR\fR
851 .sp .6
852 .RS 4n
853 Lists all entries, including those that begin with a dot (\fB\&.\fR), with the
854 exception of the working directory (\fB\&.\fR) and the parent directory
855 (\fB\&..\fR).
859 .ne 2
861 \fB\fB-b\fR\fR
865 \fB\fB--escape\fR\fR
867 .sp .6
868 .RS 4n
869 Forces printing of non-printable characters to be in the octal
870 \fB\e\fR\fIddd\fR notation.
874 .ne 2
876 \fB\fB-B\fR\fR
880 \fB\fB--ignore-backups\fR\fR
882 .sp .6
883 .RS 4n
884 Do not display any files ending with a tilde (\fB~\fR).
888 .ne 2
890 \fB\fB-c\fR\fR
892 .sp .6
893 .RS 4n
894 Uses time of last modification of the i-node (file created, mode changed, and
895 so forth) for sorting (\fB-t\fR) or printing (\fB-l\fR or \fB-n\fR).
899 .ne 2
901 \fB\fB-C\fR\fR
903 .sp .6
904 .RS 4n
905 Multi-column output with entries sorted down the columns. This is the default
906 output format.
910 .ne 2
912 \fB\fB-d\fR\fR
914 .sp .6
915 .RS 4n
916 If an argument is a directory, lists only its name (not its contents). Often
917 used with \fB-l\fR to get the status of a directory.
921 .ne 2
923 \fB\fB-e\fR\fR
925 .sp .6
926 .RS 4n
927 The same as \fB-l\fR, except displays time to the second, and with one format
928 for all files regardless of age: \fImmm dd hh:mm:ss yyyy\fR.
932 .ne 2
934 \fB\fB-E\fR\fR
936 .sp .6
937 .RS 4n
938 The same as \fB-l\fR, except displays time to the nanosecond and with one
939 format for all files regardless of age: \fIyyyy-mm-dd hh:mm:ss.nnnnnnnnn\fR
940 (ISO 8601:2000 format).
942 In addition, this option displays the offset from UTC in ISO 8601:2000 standard
943 format (+\fIhhmm\fR or -\fIhhmm\fR) or no characters if the offset is
944 indeterminable. The offset reflects the appropriate standard or alternate
945 offset in force at the file's displayed date and time, under the current
946 timezone.
950 .ne 2
952 \fB\fB-f\fR\fR
954 .sp .6
955 .RS 4n
956 Forces each argument to be interpreted as a directory and list the name found
957 in each slot. This option turns off \fB-l\fR, \fB-t\fR, \fB-s\fR, \fB-S\fR, and
958 \fB-r\fR, and turns on \fB-a\fR. The order is the order in which entries appear
959 in the directory.
963 .ne 2
965 \fB\fB-F\fR\fR
969 \fB\fB--classify\fR\fR
971 .sp .6
972 .RS 4n
973 Append a symbol after certain types of files to indicate the file type. The
974 following symbols are used:
976 .ne 2
978 \fB\fB/\fR\fR
980 .sp .6
981 .RS 4n
982 Directory
986 .ne 2
988 \fB\fB>\fR\fR
990 .sp .6
991 .RS 4n
992 Door file
996 .ne 2
998 \fB\fB|\fR\fR
1000 .sp .6
1001 .RS 4n
1002 Named pipe (\fBFIFO\fR)
1006 .ne 2
1008 \fB\fB@\fR\fR
1010 .sp .6
1011 .RS 4n
1012 Symbolic link
1016 .ne 2
1018 \fB\fB=\fR\fR
1020 .sp .6
1021 .RS 4n
1022 Socket
1026 .ne 2
1028 \fB\fB*\fR\fR
1030 .sp .6
1031 .RS 4n
1032 Executable
1038 .ne 2
1040 \fB\fB-g\fR\fR
1042 .sp .6
1043 .RS 4n
1044 The same as \fB-l\fR, except that the owner is not printed.
1048 .ne 2
1050 \fB\fB-h\fR\fR
1054 \fB\fB--human-readable\fR\fR
1056 .sp .6
1057 .RS 4n
1058 All sizes are scaled to a human readable format, for example, \fB14K\fR,
1059 \fB234M\fR, \fB2.7G\fR, or \fB3.0T\fR. Scaling is done by repetitively dividing
1060 by \fB1024\fR. The last --si or -h option determines the divisor used.
1064 .ne 2
1066 \fB\fB-H\fR\fR
1070 \fB\fB--dereference-command-line\fR\fR
1072 .sp .6
1073 .RS 4n
1074 If an argument is a symbolic link that references a directory, this option
1075 evaluates the file information and file type of the directory that the link
1076 references, rather than those of the link itself. However, the name of the link
1077 is displayed, rather than the referenced directory.
1081 .ne 2
1083 \fB\fB-i\fR\fR
1087 \fB\fB--inode\fR\fR
1089 .sp .6
1090 .RS 4n
1091 For each file, prints the i-node number in the first column of the report.
1095 .ne 2
1097 \fB\fB-k\fR\fR
1099 .sp .6
1100 .RS 4n
1101 All sizes are printed in kbytes. Equivalent to --block-size=1024.
1105 .ne 2
1107 \fB\fB-l\fR\fR
1109 .sp .6
1110 .RS 4n
1111 Lists in long format, giving mode, \fBACL\fR indication, number of links,
1112 owner, group, size in bytes, and time of last modification for each file (see
1113 above). If the file is a special file, the size field instead contains the
1114 major and minor device numbers. If the time of last modification is greater
1115 than six months ago, it is shown in the format `month date year' for the POSIX
1116 locale. When the \fBLC_TIME\fR locale category is not set to the POSIX locale,
1117 a different format of the time field can be used. Files modified within six
1118 months show `month date time'. If the file is a symbolic link, the filename is
1119 printed followed by "\fB\(->\fR" and the path name of the referenced file.
1123 .ne 2
1125 \fB\fB-L\fR\fR
1129 \fB\fB--dereference\fR\fR
1131 .sp .6
1132 .RS 4n
1133 If an argument is a symbolic link, this option evaluates the file information
1134 and file type of the file or directory that the link references, rather than
1135 those of the link itself. However, the name of the link is displayed, rather
1136 than the referenced file or directory.
1140 .ne 2
1142 \fB\fB-m\fR\fR
1144 .sp .6
1145 .RS 4n
1146 Streams output format. Files are listed across the page, separated by commas.
1150 .ne 2
1152 \fB\fB-n\fR\fR
1156 \fB\fB--numeric-uid-gid\fR\fR
1158 .sp .6
1159 .RS 4n
1160 The same as \fB-l\fR, except that the owner's \fBUID\fR and group's \fBGID\fR
1161 numbers are printed, rather than the associated character strings.
1165 .ne 2
1167 \fB\fB-o\fR\fR
1171 \fB\fB--no-group\fR\fR
1173 .sp .6
1174 .RS 4n
1175 The same as \fB-l\fR, except that the group is not printed.
1179 .ne 2
1181 \fB\fB-p\fR\fR
1183 .sp .6
1184 .RS 4n
1185 Puts a slash (\fB/\fR) after each filename if the file is a directory.
1189 .ne 2
1191 \fB\fB-q\fR\fR
1195 \fB\fB--hide-control-chars\fR\fR
1197 .sp .6
1198 .RS 4n
1199 Forces printing of non-printable characters in file names as the character
1200 question mark (\fB?\fR).
1204 .ne 2
1206 \fB\fB-r\fR\fR
1210 \fB\fB--reverse\fR\fR
1212 .sp .6
1213 .RS 4n
1214 Reverses the order of sort to get reverse alphabetic, oldest first, or smallest
1215 file size first as appropriate.
1219 .ne 2
1221 \fB\fB-R\fR\fR
1225 \fB\fB--recursive\fR\fR
1227 .sp .6
1228 .RS 4n
1229 Recursively lists subdirectories encountered.
1233 .ne 2
1235 \fB\fB-s\fR\fR
1239 \fB\fB--size\fR\fR
1241 .sp .6
1242 .RS 4n
1243 Indicate the total number of file system blocks consumed by each file
1244 displayed.
1248 .ne 2
1250 \fB\fB-S\fR\fR
1252 .sp .6
1253 .RS 4n
1254 Sort by file size (in decreasing order) and for files with the same size by
1255 file name (in increasing alphabetic order) instead of just by name.
1259 .ne 2
1261 \fB\fB-t\fR\fR
1263 .sp .6
1264 .RS 4n
1265 Sorts by time stamp (latest first) instead of by name. The default is the last
1266 modification time. See \fB-c\fR, \fB-u\fR and \fB-%\fR.
1270 .ne 2
1272 \fB\fB-u\fR\fR
1274 .sp .6
1275 .RS 4n
1276 Uses time of last access instead of last modification for sorting (with the
1277 \fB-t\fR option) or printing (with the \fB-l\fR option).
1281 .ne 2
1283 \fB\fB-U\fR\fR
1285 .sp .6
1286 .RS 4n
1287 Output is unsorted.
1291 .ne 2
1293 \fB\fB-v\fR\fR
1295 .sp .6
1296 .RS 4n
1297 The same as \fB-l\fR, except that verbose ACL information is displayed as well
1298 as the \fB-l\fR output. ACL information is displayed even if the file or
1299 directory doesn't have an ACL.
1303 .ne 2
1305 \fB\fB-V\fR\fR
1307 .sp .6
1308 .RS 4n
1309 The same as \fB-l\fR, except that compact ACL information is displayed after
1310 the \fB-l\fR output.
1312 The \fB-V\fR option is only applicable to file systems that support NFSv4 ACLs,
1313 such as the Solaris ZFS file system.
1315 The format of the displayed ACL is as follows:
1317 .in +2
1319 \fIentry_type\fR : \fIpermissions\fR : \fIinheritance_flags\fR : \fIaccess_type\fR
1321 .in -2
1324 \fIentry_type\fR is displayed as one of the following:
1326 .ne 2
1328 \fBuser:\fIusername\fR\fR
1330 .sp .6
1331 .RS 4n
1332 Additional user access for \fIusername\fR.
1336 .ne 2
1338 \fBgroup:\fIgroupname\fR\fR
1340 .sp .6
1341 .RS 4n
1342 Additional group access for group \fIgroupname\fR.
1346 .ne 2
1348 \fBowner@\fR
1350 .sp .6
1351 .RS 4n
1352 File owner.
1356 .ne 2
1358 \fBgroup@\fR
1360 .sp .6
1361 .RS 4n
1362 File group owner.
1366 .ne 2
1368 \fBeveryone@\fR
1370 .sp .6
1371 .RS 4n
1372 Everyone access, including file owner and file group owner. This is not
1373 equivalent to the POSIX other class.
1376 The following permissions, supported by the NFSv4 ACL model, are displayed by
1377 using the \fB-v\fR or \fB-V\fR options:
1379 .ne 2
1381 \fBread_data (\fBr\fR)\fR
1383 .sp .6
1384 .RS 4n
1385 Permission to read the data of a file.
1389 .ne 2
1391 \fBlist_directory (\fBr\fR)\fR
1393 .sp .6
1394 .RS 4n
1395 Permission to list the contents of a directory.
1399 .ne 2
1401 \fBwrite_data (\fBw\fR)\fR
1403 .sp .6
1404 .RS 4n
1405 Permission to modify a file's data. anywhere in the file's offset range.
1409 .ne 2
1411 \fBadd_file (\fBw\fR)\fR
1413 .sp .6
1414 .RS 4n
1415 Permission to add a new file to a directory.
1419 .ne 2
1421 \fBappend_data (\fBp\fR)\fR
1423 .sp .6
1424 .RS 4n
1425 The ability to modify a file's data, but only starting at EOF.
1429 .ne 2
1431 \fBadd_subdirectory (\fBp\fR)\fR
1433 .sp .6
1434 .RS 4n
1435 Permission to create a subdirectory to a directory.
1439 .ne 2
1441 \fBread_xattr (\fBR\fR)\fR
1443 .sp .6
1444 .RS 4n
1445 Ability to read the extended attributes of a file.
1449 .ne 2
1451 \fBwrite_xattr (\fBW\fR)\fR
1453 .sp .6
1454 .RS 4n
1455 Ability to create extended attributes or write to the extended attribute
1456 directory.
1460 .ne 2
1462 \fBexecute (\fBx\fR)\fR
1464 .sp .6
1465 .RS 4n
1466 Permission to execute a file.
1470 .ne 2
1472 \fBread_attributes (\fBa\fR)\fR
1474 .sp .6
1475 .RS 4n
1476 The ability to read basic attributes (non-ACLs) of a file.
1480 .ne 2
1482 \fBwrite_attributes (\fBA\fR)\fR
1484 .sp .6
1485 .RS 4n
1486 Permission to change the times associated with a file or directory to an
1487 arbitrary value.
1491 .ne 2
1493 \fBdelete (\fBd\fR)\fR
1495 .sp .6
1496 .RS 4n
1497 Permission to delete a file.
1501 .ne 2
1503 \fBdelete_child (\fBD\fR)\fR
1505 .sp .6
1506 .RS 4n
1507 Permission to delete a file within a directory.
1511 .ne 2
1513 \fBread_acl (\fBc\fR)\fR
1515 .sp .6
1516 .RS 4n
1517 Permission to read the ACL of a file.
1521 .ne 2
1523 \fBwrite_acl (\fBC\fR)\fR
1525 .sp .6
1526 .RS 4n
1527 Permission to write the ACL of a file.
1531 .ne 2
1533 \fBwrite_owner (\fBo\fR)\fR
1535 .sp .6
1536 .RS 4n
1537 Permission to change the owner of a file.
1541 .ne 2
1543 \fBsynchronize (\fBs\fR)\fR
1545 .sp .6
1546 .RS 4n
1547 Permission to access file locally at server with synchronize reads and writes.
1551 .ne 2
1553 \fB\fB-\fR\fR
1555 .sp .6
1556 .RS 4n
1557 No permission granted
1560 The following inheritance flags, supported by the NFSv4 ACL model, are
1561 displayed by using the \fB-v\fR or \fB-V\fR options:
1563 .ne 2
1565 \fBfile_inherit (\fBf\fR)\fR
1567 .sp .6
1568 .RS 4n
1569 Inherit to all newly created files.
1573 .ne 2
1575 \fBdir_inherit (\fBd\fR)\fR
1577 .sp .6
1578 .RS 4n
1579 Inherit to all newly created directories.
1583 .ne 2
1585 \fBinherit_only (\fBi\fR)\fR
1587 .sp .6
1588 .RS 4n
1589 When placed on a directory, do not apply to the directory, only to newly
1590 created files and directories. This flag requires that either
1591 \fBfile_inherit\fR and or \fBdir_inherit\fR is also specified.
1595 .ne 2
1597 \fBno_propagate (\fBn\fR)\fR
1599 .sp .6
1600 .RS 4n
1601 Indicates that ACL entries should be inherited to objects in a directory, but
1602 inheritance should stop after descending one level. This flag is dependent upon
1603 either \fBfile_inherit\fR and or \fBdir_inherit\fR also being specified.
1607 .ne 2
1609 \fBsuccessful_access (\fBS\fR)\fR
1611 .sp .6
1612 .RS 4n
1613 Indicates if an alarm or audit record should be initiated upon successful
1614 accesses. Used with audit/alarm ACE types.
1618 .ne 2
1620 \fBfailed_access (\fBF\fR)\fR
1622 .sp .6
1623 .RS 4n
1624 Indicates if an alarm or audit record should be initiated when access fails.
1625 Used with audit/alarm ACE types.
1629 .ne 2
1631 \fBinherited (\fBI\fR)\fR
1633 .sp .6
1634 .RS 4n
1635 ACE was inherited.
1639 .ne 2
1641 \fB\fB-\fR\fR
1643 .sp .6
1644 .RS 4n
1645 No permission granted.
1648 \fIaccess_type\fR is displayed as one of the following types:
1650 .ne 2
1652 \fBalarm\fR
1654 .RS 9n
1655 Permission field that specifies permissions that should trigger an alarm.
1659 .ne 2
1661 \fBallow\fR
1663 .RS 9n
1664 Permission field that specifies allow permissions.
1668 .ne 2
1670 \fBaudit\fR
1672 .RS 9n
1673 Permission field that specifies permissions that should be audited.
1677 .ne 2
1679 \fBdeny\fR
1681 .RS 9n
1682 Permission field that specifies deny permissions.
1685 For example:
1687 .in +2
1689 $ ls -dV /sandbox/dir.1
1690   drwxr-xr-x+  2 root     root           2 Jan 17 15:09 dir.1
1691                   user:marks:r-------------:fd-----:allow
1692                       owner@:--------------:-------:deny
1693                       owner@:rwxp---A-W-Co-:-------:allow
1694                       group@:-w-p----------:-------:deny
1695                       group@:r-x-----------:-------:allow
1696                    everyone@:-w-p---A-W-Co-:-------:deny
1697                    everyone@:r-x---a-R-c--s:-------:allow
1699                            ||||||||||||||||:||||||+ inherited access
1700                              ||||||||||||||:||||||+ failed access
1701                              ||||||||||||||:|||||+--success access
1702                              ||||||||||||||:||||+-- no propagate
1703                              ||||||||||||||:|||+--- inherit only
1704                              ||||||||||||||:||+---- directory inherit
1705                              ||||||||||||||:|+----- file inherit
1706                              ||||||||||||||
1707                              ||||||||||||||+ sync
1708                              |||||||||||||+- change owner
1709                              ||||||||||||+-- write ACL
1710                              |||||||||||+--- read ACL
1711                              ||||||||||+---- write extended attributes
1712                              |||||||||+----- read extended attributes
1713                              ||||||||+------ write attributes
1714                              |||||||+------- read attributes
1715                              ||||||+-------- delete child
1716                              |||||+--------- delete
1717                              ||||+---------- append
1718                              |||+----------- execute
1719                              ||+------------ write data
1720                              |+------------- read data
1722 .in -2
1728 .ne 2
1730 \fB\fB-w\fR \fIcols\fR\fR
1734 \fB\fB--width\fR \fIcols\fR\fR
1736 .sp .6
1737 .RS 4n
1738 Multi-column output where the column width is forced to \fIcols\fR.
1742 .ne 2
1744 \fB\fB-x\fR\fR
1746 .sp .6
1747 .RS 4n
1748 Multi-column output with entries sorted across rather than down the page.
1752 .ne 2
1754 \fB\fB-1\fR\fR
1756 .sp .6
1757 .RS 4n
1758 Prints one entry per line of output.
1762 .ne 2
1764 \fB\fB-@\fR\fR
1766 .sp .6
1767 .RS 4n
1768 The same as \fB-l\fR, except that extended attribute information overrides
1769 \fBACL\fR information. An \fB@\fR is displayed after the file permission bits
1770 for files that have extended attributes.
1774 .ne 2
1776 \fB\fB-c\fR | \fB-v\fR\fR
1778 .sp .6
1779 .RS 4n
1780 The same as \fB-l\fR, and in addition displays the extended system attributes
1781 associated with the file when extended system attributes are fully supported by
1782 the underlying file system. The option \fB-/\fR supports two option arguments
1783 \fBc\fR (compact mode) and \fBv\fR (verbose mode).
1785 .ne 2
1787 \fB\fBappendonly\fR\fR
1789 .sp .6
1790 .RS 4n
1791 Allows a file to be modified only at offset \fBEOF\fR. Attempts to modify a
1792 file at a location other than \fBEOF\fR fails with \fBEPERM\fR.
1796 .ne 2
1798 \fB\fBarchive\fR\fR
1800 .sp .6
1801 .RS 4n
1802 Indicates if a file has been modified since it was last backed up. Whenever the
1803 modification time (\fBmtime\fR) of a file is changed the \fBarchive\fR
1804 attribute is set.
1808 .ne 2
1810 \fB\fBav_modified\fR\fR
1812 .sp .6
1813 .RS 4n
1814 ZFS sets the anti-virus attribute which whenever a file's content or size
1815 changes or when the file is renamed.
1819 .ne 2
1821 \fB\fBav_quarantined\fR\fR
1823 .sp .6
1824 .RS 4n
1825 Anti-virus software sets to mark a file as quarantined.
1829 .ne 2
1831 \fB\fBcrtime\fR\fR
1833 .sp .6
1834 .RS 4n
1835 Timestamp when a file is created.
1839 .ne 2
1841 \fB\fBhidden\fR\fR
1843 .sp .6
1844 .RS 4n
1845 Marks a file as hidden.
1849 .ne 2
1851 \fB\fBimmutable\fR\fR
1853 .sp .6
1854 .RS 4n
1855 Prevents the content of a file from being modified. Also prevents all metadata
1856 changes, except for access time updates. When placed on a directory, prevents
1857 the deletion and creation of files in the directories. Attempts to modify the
1858 content of a file or directory marked as \fBimmutable\fR fail with \fBEPERM\fR.
1859 Attempts to modify any attributes (with the exception of access time and, with
1860 the proper privileges, the \fBimmutable\fR) of a file marked as \fBimmutable\fR
1861 fails with \fBEPERM\fR.
1865 .ne 2
1867 \fB\fBnodump\fR\fR
1869 .sp .6
1870 .RS 4n
1871 Solaris systems have no special semantics for this attribute.
1875 .ne 2
1877 \fB\fBnounlink\fR\fR
1879 .sp .6
1880 .RS 4n
1881 Prevents a file from being deleted. On a directory, the attribute also prevents
1882 any changes to the contents of the directory. That is, no files within the
1883 directory can be removed or renamed. The \fBerrno\fR \fBEPERM\fR is returned
1884 when attempting to unlink or rename files and directories that are marked as
1885 \fBnounlink\fR.
1889 .ne 2
1891 \fB\fBreadonly\fR\fR
1893 .sp .6
1894 .RS 4n
1895 Marks a file as \fBreadonly\fR. Once a file is marked as \fBreadonly\fR the
1896 content data of the file cannot be modified. Other metadata for the file can
1897 still be modified.
1901 .ne 2
1903 \fB\fBsystem\fR\fR
1905 .sp .6
1906 .RS 4n
1907 Solaris systems have no special semantics for this attribute.
1914 The display characters used in compact mode (\fB-/ c\fR) are as follows:
1916 .in +2
1918 Attribute Name     Display
1919 archive            A
1920 hidden             H
1921 readonly           R
1922 system             S
1923 appendonly         a
1924 nodump             d
1925 immutable          i
1926 av_modified        m
1927 av_quarantined     q
1928 nounlink           u
1930 .in -2
1935 The display in verbose mode (/ v) uses full attribute names when it is set and
1936 the name prefixed by 'no' when it is not set.
1939 The attribute name \fBcrtime\fR and all other timestamps are handled by the
1940 option \fB-%\fR with the respective timestamp option arguments and also with
1941 \fBall\fR option argument. The display positions are as follows: The display in
1942 verbose mode (\fB-/ v\fR) uses full attribute names  when it is set and the
1943 name prefixed by \fBno\fR when it is not set. The attribute name \fBcrtime\fR
1944 and all other timestamps are handled by the option \fB-%\fR with the respective
1945 timestamp option arguments and also with \fBall\fR option argument.
1948 The display positions are as follows:
1950 .in +2
1952 {||||||||||}
1953  |||||||||+- u (nounlink)
1954  ||||||||+-- q (av_quarantined)
1955  |||||||+--- m (av_modified)
1956  ||||||+---- i (immutable)
1957  |||||+----- d (nodump)
1958  ||||+------ a (appendonly)
1959  |||+------- S (system)
1960  ||+-------- R (readonly)
1961  |+--------- H (hidden)
1962  +---------- A (archive)
1964 .in -2
1968 .in +2
1970 -% atime | crtime | ctime | mtime | all
1972 .in -2
1976 .ne 2
1978 \fB\fBatime\fR\fR
1980 .sp .6
1981 .RS 4n
1982 Equivalent to \fB-u\fR.
1986 .ne 2
1988 \fB\fBcrtime\fR\fR
1990 .sp .6
1991 .RS 4n
1992 Uses the creation time of the file for sorting or printing.
1996 .ne 2
1998 \fB\fBctime\fR\fR
2000 .sp .6
2001 .RS 4n
2002 Equivalent to \fB-c\fR.
2006 .ne 2
2008 \fB\fBmtime\fR\fR
2010 .sp .6
2011 .RS 4n
2012 Uses the last modification time of the file contents for sorting or printing.
2017 If extended system attributes are not supported or if the user does not have
2018 \fBread\fR permission on the file or if the \fBcrtime\fR extended attribute is
2019 not set, \fBcrtime\fR is treated as a synonym for \fBmtime\fR.
2022 When option argument \fB-all\fR is specified, all available timestamps are
2023 printed which includes \fB-atime\fR, \fB-ctime\fR, \fB-mtime\fR and on the
2024 extended system attribute supporting file systems, \fB-crtime\fR (create time).
2025 The option \fB-% all\fR does not effect which timestamp is displayed in long
2026 format and does not affect sorting.
2028 .ne 2
2030 \fB\fB--block-size\fR \fIsize\fR\fR
2032 .sp .6
2033 .RS 4n
2034 Display sizes in multiples of size. Size can be scaled by suffixing one of
2035 \fBYyZzEePpTtGgMmKk\fR. Additionally, a \fBB\fR can be placed at the end to
2036 indicate powers of 10 instead of 2. For example, . \fB10mB\fR means blocks of
2037 \fB10000000\fR bytes while \fB10m\fR means blocks of \fB10*2^20 -- 10485760
2038 --\fR bytes. This is mutually exclusive with the \fB-h\fR option.
2042 .ne 2
2044 \fB\fB--color\fR \fB[=\fR\fIwhen\fR\fB]\fR\fR
2048 \fB\fB--colour\fR\fB[=\fR\fIwhen\fR\fB]\fR\fR
2050 .sp .6
2051 .RS 4n
2052 Display filenames using color on color-capable terminals. \fIwhen\fR is an
2053 optional argument that determines when to display color output.
2055 Possible values for \fIwhen\fR are:
2057 .ne 2
2059 \fB\fBalways\fR\fR
2063 \fB\fByes\fR\fR
2067 \fB\fBforce\fR\fR
2069 .sp .6
2070 .RS 4n
2071 Always use color.
2075 .ne 2
2077 \fB\fBauto\fR\fR
2081 \fB\fBtty\fR\fR
2085 \fB\fBif-tty\fR\fR
2087 .sp .6
2088 .RS 4n
2089 Use color if a terminal is present.
2093 .ne 2
2095 \fB\fBno\fR\fR
2099 \fB\fBnever\fR\fR
2103 \fB\fBnone\fR\fR
2105 .sp .6
2106 .RS 4n
2107 Never use color. This is the default
2110 See \fBCOLOR OUTPUT\fR for information on how to control the output colors.
2114 .ne 2
2116 \fB\fB--file-type\fR\fR
2118 .sp .6
2119 .RS 4n
2120 Display a suffix after a file depending on it's type, similar to the \fB-F\fR
2121 option, except \fB*\fR is not appended to executable files.
2125 .ne 2
2127 \fB\fB-si\fR\fR
2131 \fB\fB--\fR\fR
2133 .sp .6
2134 .RS 4n
2135 Display human scaled sizes similar to the \fB-h\fR option, except values are
2136 repeatedly divided by 1000 instead of 1024. The last option \fB--si\fR or
2137 \fB-h\fR determines the divisor used.
2141 .ne 2
2143 \fB\fB--time-style\fR style\fR
2145 .sp .6
2146 .RS 4n
2147 Display times using the specified style. This does not effect the times
2148 displayed for extended attributes (\fB-%\fR).
2150 Possible values for \fIstyle\fR are:
2152 .ne 2
2154 \fB\fBfull-iso\fR\fR
2156 .sp .6
2157 .RS 4n
2158 Equivalent to \fB-E\fR.
2162 .ne 2
2164 \fB\fBlong-iso\fR\fR
2166 .sp .6
2167 .RS 4n
2168 Display in \fIYYYY-MM-DD HH:MM\fR for all files.
2172 .ne 2
2174 \fB\fBiso\fR\fR
2176 .sp .6
2177 .RS 4n
2178 Display older files using \fIYYYY-MM-DD\fR and newer files with \fIMM-DD
2179 HH:MM\fR.
2183 .ne 2
2185 \fB\fBlocale\fR\fR
2187 .sp .6
2188 .RS 4n
2189 Use the default locale format for old and new files. This is the default.
2193 .ne 2
2195 \fB\fB+FORMAT\fR\fR
2197 .sp .6
2198 .RS 4n
2199 Use a custom format. Values are the same as described in \fBstrftime\fR(3C). If
2200 a NEWLINE appears in the string, the first line is used for older files and the
2201 second line is used for newer files. Otherwise, the given format is used for
2202 all files.
2207 .SS "/usr/bin/ls"
2209 .ne 2
2211 \fB\fB-F\fR\fR
2213 .sp .6
2214 .RS 4n
2215 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2216 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2217 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2218 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2219 with a trailing equals sign (\fB=\fR). Follows \fBsymlinks\fR named as
2220 operands.
2224 .ne 2
2226 \fB\fB--file-type\fR\fR
2228 .sp .6
2229 .RS 4n
2230 Marks entries as with \fB-F\fR with the exception of executable files.
2231 Executable files are not marked. Follows symlinks named as operands.
2236 Specifying more than one of the options in the following mutually exclusive
2237 pairs is not considered an error: \fB-C\fR and \fB-l\fR (ell), \fB-m\fR and
2238 \fB-l\fR (ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR (ell). The
2239 \fB-l\fR option overrides the other option specified in each pair.
2242 Specifying more than one of the options in the following mutually exclusive
2243 groups is not considered an error: \fB-C\fR and \fB-1\fR (one), \fB-H\fR and
2244 \fB-L\fR, \fB-c\fR and \fB-u\fR, and \fB-e\fR and \fB-E\fR, and \fB-t\fR and
2245 \fB-S\fR. The last option specifying a specific timestamp (\fB-c\fR, \fB-u\fR,
2246 \fB-% atime\fR , \fB-% crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR)
2247 determines the timestamps used for sorting or in long format listings. The last
2248 option \fB-t\fR, \fB-S\fR, or \fB-U\fR determines the sorting behavior.
2249 .SS "/usr/xpg4/bin/ls"
2251 .ne 2
2253 \fB\fB-F\fR\fR
2255 .sp .6
2256 .RS 4n
2257 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2258 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2259 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2260 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2261 with a trailing equals sign (\fB=\fR). Follows symlinks named as operands.
2265 .ne 2
2267 \fB\fB--file-type\fR\fR
2269 .sp .6
2270 .RS 4n
2271 Marks entries as with \fB-F\fR with the exception of executable files.
2272 Executable files are not marked. Follows symlinks named as operands.
2277 Specifying more than one of the options in the following groups of mutually
2278 exclusive options is not considered an error: \fB-C\fR and \fB-l\fR (ell),
2279 \fB-m\fR and \fB-l\fR (ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR
2280 (ell), \fB-C\fR and \fB-1\fR (one), \fB-H\fR and \fB-L\fR, \fB-c\fR and
2281 \fB-u\fR, \fB-e\fR and \fB-E\fR, \fB-t\fR and \fB-S\fR and \fB-U\fR. The last
2282 option specifying a specific timestamp (\fB-c\fR, \fB-u\fR, \fB-% atime\fR ,
2283 \fB-% crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR) determines the timestamps
2284 used for sorting or in long format listings. The last \fB-t\fR, \fB-S\fR, or
2285 \fB-U\fR option determines the sorting behavior.
2286 .SS "/usr/xpg6/bin/ls"
2288 .ne 2
2290 \fB\fB-F\fR\fR
2292 .sp .6
2293 .RS 4n
2294 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2295 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2296 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2297 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2298 with a trailing equals sign (\fB=\fR). Does not follow symlinks named as
2299 operands unless the \fB-H\fR or \fB-L\fR option is specified.
2303 .ne 2
2305 \fB\fB--file-type\fR\fR
2307 .sp .6
2308 .RS 4n
2309 Marks entries as with \fB-F\fR with the exception of executable files.
2310 Executable files are not marked. Does not follow symlinks named as operands
2311 unless the \fB-H\fR or \fB-L\fR option is specified.
2316 Specifying more than one of the options in the following mutually exclusive
2317 pairs is not considered an error: \fB-C\fR and \fB-l\fR (ell), m and
2318 \fB-l\fR(ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR (ell),
2319 \fB-C\fR and \fB-1\fR (one), \fB-H\fR and -\fB-L\fR, \fB-c\fR and \fB-u\fR,
2320 \fB-e\fR and \fB-E\fR, \fB-t\fR and \fB-S\fR and \fB-U\fR. The last option
2321 specifying a specific timestamp (\fB-c\fR, \fB-u\fR, \fB-% atime\fR , \fB-%
2322 crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR) determines the timestamps used
2323 for sorting or in long format listings. The last \fB-t\fR, \fB-S\fR, or
2324 \fB-U\fR option determines the sorting behavior.
2325 .SH OPERANDS
2328 The following operand is supported:
2330 .ne 2
2332 \fB\fIfile\fR\fR
2334 .sp .6
2335 .RS 4n
2336 A path name of a file to be written. If the file specified is not found, a
2337 diagnostic message is output on standard error.
2340 .SH USAGE
2343 See \fBlargefile\fR(5) for the description of the behavior of \fBls\fR when
2344 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
2345 .SH EXAMPLES
2347 \fBExample 1 \fRViewing File Permissions
2350 The following example shows how to display detailed information about a file.
2353 .in +2
2355 % ls -l file.1
2356 -rw-r--r--   1 gozer    staff     206663 Mar 14 10:15 file.1
2358 .in -2
2363 The permissions string above (\fB-rw-r--r--\fR) describes that the file owner
2364 has read and write permissions, the owning group has read permissions, and
2365 others have read permissions.
2369 The following example shows how to display detailed information about a
2370 directory.
2373 .in +2
2375 % ls -ld test.dir
2376 drwxr-xr-x   2 gozer    staff          2 Mar 14 10:17 test.dir
2378 .in -2
2383 The permissions string above (\fBdrwxr-xr-x\fR) describes that the directory
2384 owner has read, write, and search permissions, the owning group has read and
2385 search permissions, and others have read and search permissions.
2389 Another example of listing file permissions is as follows:
2392 .in +2
2394 % ls -l file.2
2395 -rw-rwl---   1 gozer    staff     206663 Mar 14 10:47 file.2
2397 .in -2
2402 The permissions string above (\fB-rw-rwl---\fR) describes that the file owner
2403 has read and write permissions, the owning group has read and write
2404 permissions, and the file can be locked during access.
2407 \fBExample 2 \fRDisplaying ACL Information on Files and Directories
2410 The following example shows how to display verbose ACL information on a ZFS
2411 file.
2414 .in +2
2416 % ls -v file.1
2417 -rw-r--r--   1 marks    staff     206663 Mar 14 10:15 file.1
2418      0:owner@:execute:deny
2419      1:owner@:read_data/write_data/append_data/write_xattr/write_attributes
2420           /write_acl/write_owner:allow
2421      2:group@:write_data/append_data/execute:deny
2422      3:group@:read_data:allow
2423      4:everyone@:write_data/append_data/write_xattr/execute/write_attributes
2424           /write_acl/write_owner:deny
2425      5:everyone@:read_data/read_xattr/read_attributes/read_acl/synchronize
2426           :allow
2428 .in -2
2433 The following example shows how to display compact ACL information on a ZFS
2434 directory.
2437 .in +2
2439 % ls -dV test.dir
2440 drwxr-xr-x   2 marks    staff          2 Mar 14 10:17 test.dir
2441             owner@:--------------:------:deny
2442             owner@:rwxp---A-W-Co-:------:allow
2443             group@:-w-p----------:------:deny
2444             group@:r-x-----------:------:allow
2445             everyone@:-w-p---A-W-Co-:------:deny
2446             everyone@:r-x---a-R-c--s:------:allow
2448 .in -2
2453 The following example illustrates the \fBls\fR \fB-v\fR behavior when listing
2454 ACL  information on a UFS file.
2457 .in +2
2459 $ ls -v file.3
2460 -rw-r--r--   1 root     root        2703 Mar 14 10:59 file.3
2461      0:user::rw-
2462      1:group::r--               #effective:r--
2463      2:mask:r--
2464      3:other:r--
2466 .in -2
2470 \fBExample 3 \fRPrinting the Names of All Files
2473 The following example prints the names of all files in the current directory,
2474 including those that begin with a dot (\fB\&.\fR), which normally do not print:
2477 .in +2
2479 example% \fBls -a\fR
2481 .in -2
2485 \fBExample 4 \fRProviding File Information
2488 The following example provides file information:
2491 .in +2
2493 example% ls -aisn
2495 .in -2
2500 This command provides information on \fBa\fRll files, including those that
2501 begin with a dot (\fBa\fR), the \fBi\fR-number, the memory address of the
2502 i-node associated with the file\(emprinted in the left-hand column (\fBi\fR);
2503 the \fBs\fRize (in blocks) of the files, printed in the column to the right of
2504 the i-numbers (\fBs\fR); finally, the report is displayed in the \fBn\fRumeric
2505 version of the long list, printing the \fBUID\fR (instead of user name) and
2506 \fBGID\fR (instead of group name) numbers associated with the files.
2510 When the sizes of the files in a directory are listed, a total count of blocks,
2511 including indirect blocks, is printed.
2514 \fBExample 5 \fRProviding Extended System Attributes Information
2516 .in +2
2518 example% ls -/ c file    (extended system attribute in compact mode)
2519 -rw-r--r--   1 root     root           0 May 10 14:17 file
2520                          {AHRSadim-u}
2522 .in -2
2527 In this example, \fBav_quarantined\fR is not set.
2529 .in +2
2531 example% ls -/ v file (extended system attribute in verbose mode)
2532 -rw-r--r--   1 root     root           0 May 10 14:17 file
2533                 {archive,hidden,readonly,system,appendonly\e
2534                  nodump,immutable,av_modified,\e
2535                  noav_quarantined,nounlink}
2537 example% ls -/ v file     (no extended system attribute)
2538 -rw-r--r--  1 root    staff        0 May 16 14:48 file
2539                {}
2541 example% ls -/ c file        (extended system attribute
2542                               supported file system)
2544 -rw-r--r--  1 root staff        3 Jun  4 22:04 file
2545                {A------m--}
2547 .in -2
2552 \fBarchive\fR and \fBav_modified\fR attributes are set by default on  an
2553 extended system attribute supported file.
2555 .in +2
2557 example% ls -/ c  -%crtime file
2559 -rw-r--r--    root     root          0 May 10 14:17 file
2560                {AHRSadim-u}
2562 .in -2
2567 This example displays the timestamp as the creation time:
2569 .in +2
2571 example% ls -l -%all file
2572 -rw-r--r--   1 root     root           0 May 10 14:17    file
2573                 timestamp: atime    Jun 14 08:47:37 2007
2574                 timestamp: ctime    May 10 14:20:23 2007
2575                 timestamp: mtime    May 10 14:17:56 2007
2576                 timestamp: crtime   May 10 14:17:56 2007
2578 example% ls -%crtime -tl file*
2580 -rw-r--r--   1 foo      staff          3 Jun  4 22:04 file1
2581 -rw-r--r--   1 root     root           0 May 10 14:17 file
2582 -rw-r--r--   1 foo      staff          0 May  9 13:49 file.1
2584 .in -2
2589 In this example the files are sorted by creation time.
2590 .SH ENVIRONMENT VARIABLES
2593 See \fBenviron\fR(5) for descriptions of the following environment variables
2594 that affect the execution of \fBls\fR: \fBLANG\fR, \fBLC_ALL\fR,
2595 \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_TIME\fR, \fBLC_MESSAGES\fR,
2596 \fBNLSPATH\fR, and \fBTZ\fR.
2598 .ne 2
2600 \fB\fBCOLUMNS\fR\fR
2602 .sp .6
2603 .RS 4n
2604 Determines the user's preferred column position width for writing multiple
2605 text-column output. If this variable contains a string representing a decimal
2606 integer, the \fBls\fR utility calculates how many path name text columns to
2607 write (see \fB-C\fR) based on the width provided. If \fBCOLUMNS\fR is not set
2608 or is invalid, 80 is used. The column width chosen to write the names of files
2609 in any given directory is constant. File names are not be truncated to fit into
2610 the multiple text-column output.
2614 .ne 2
2616 \fB\fBLS_COLORS\fR\fR
2618 .sp .6
2619 .RS 4n
2620 Determines the coloring scheme used when displaying color output. If not set
2621 and color output is specified, a default scheme is used. If TERM is not set, no
2622 color output is used.
2626 .ne 2
2628 \fB\fBTERM\fR\fR
2630 .sp .6
2631 .RS 4n
2632 Determine the terminal type. If this variable is unset or NULL, no color output
2633 is generated regardless of the value of the --color option.
2636 .SH EXIT STATUS
2638 .ne 2
2640 \fB\fB0\fR\fR
2642 .RS 6n
2643 All information was written successfully.
2647 .ne 2
2649 \fB\fB>0\fR\fR
2651 .RS 6n
2652 An error occurred.
2655 .SH FILES
2657 .ne 2
2659 \fB\fB/etc/group\fR\fR
2661 .sp .6
2662 .RS 4n
2663 group IDs for \fBls\fR \fB-l\fR and \fBls\fR \fB-g\fR
2667 .ne 2
2669 \fB\fB/etc/passwd\fR\fR
2671 .sp .6
2672 .RS 4n
2673 user IDs for \fBls\fR \fB-l\fR and \fBls\fR \fB-o\fR
2677 .ne 2
2679 \fB\fB/usr/share/lib/terminfo/?/*\fR\fR
2681 .sp .6
2682 .RS 4n
2683 terminal information database
2686 .SH ATTRIBUTES
2689 See \fBattributes\fR(5) for descriptions of the following attributes:
2690 .SS "/usr/bin/ls"
2695 box;
2696 c | c
2697 l | l .
2698 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2700 CSI     Enabled
2702 Interface Stability     Committed
2704 Standard        See below.
2709 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2710 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2711 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2712 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2713 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2714 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2715 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2716 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2717 .SS "/usr/xpg4/bin/ls"
2722 box;
2723 c | c
2724 l | l .
2725 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2727 CSI     Enabled
2729 Interface Stability     Committed
2731 Standard        See below.
2736 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2737 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2738 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2739 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2740 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2741 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2742 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2743 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2744 .SS "/usr/xpg6/bin/ls"
2749 box;
2750 c | c
2751 l | l .
2752 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2754 CSI     Enabled
2756 Interface Stability     Committed
2758 Standard        See below.
2763 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2764 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2765 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2766 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2767 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2768 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2769 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2770 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2771 .SH SEE ALSO
2774 \fBchmod\fR(1), \fBcp\fR(1), \fBsetfacl\fR(1), \fBfgetattr\fR(3C),
2775 \fBstrftime\fR(3C), \fBterminfo\fR(4), \fBacl\fR(5), \fBattributes\fR(5),
2776 \fBenviron\fR(5), \fBfsattr\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
2777 .SH NOTES
2780 Unprintable characters in file names can confuse the columnar output options.
2783 The total block count is incorrect if there are hard links among the files.
2786 The sort order of \fBls\fR output is affected by the locale and can be
2787 overridden by the \fBLC_COLLATE\fR environment variable. For example, if
2788 \fBLC_COLLATE\fR equals \fBC\fR, dot files appear first, followed by names
2789 beginning with upper-case letters, then followed by names beginning with
2790 lower-case letters. But if \fBLC_COLLATE\fR equals \fBen_US.ISO8859-1\fR, then
2791 leading dots as well as case are ignored in determining the sort order.