Unleashed v1.4
[unleashed.git] / share / man / man1 / ls.1
blob35d553a694dabdca3b2e01229b864ea97dc76855
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
45 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
46 .\" Copyright 2014 Nexenta Systems, Inc.  All Rights Reserved.
47 .\"
48 .TH LS 1 "Oct 25, 2017"
49 .SH NAME
50 ls \- list contents of directory
51 .SH SYNOPSIS
52 .LP
53 .nf
54 \fB/usr/bin/ls\fR [\fB-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@\fR]
55      [\fB-/ c\fR | \fBv\fR] [\fB-% atime | crtime | ctime | mtime | all\fR]
56      [--block-size size] [--color[=\fIwhen\fR]] [--file-type]
57      [--si] [--time-style \fIstyle\fR] [\fIfile\fR]...
58 .fi
60 .SH DESCRIPTION
61 .LP
62 For each \fIfile\fR that is a directory, \fBls\fR lists the contents of the
63 directory. For each \fIfile\fR that is an ordinary file, \fBls\fR repeats its
64 name and any other information requested. The output is sorted alphabetically
65 by default. When no argument is given, the current directory (\fB\&.\fR) is
66 listed. When several arguments are given, the arguments are first sorted
67 appropriately, but file arguments appear before directories and their contents.
68 .sp
69 .LP
70 There are three major listing formats. The default format for output directed
71 to a terminal is multi\(micolumn with entries sorted down the columns. The
72 \fB-1\fR option allows single column output and \fB-m\fR enables stream output
73 format. In order to determine output formats for the \fB-C\fR, \fB-x\fR, and
74 \fB-m\fR options, \fBls\fR uses an environment variable, \fBCOLUMNS\fR, to
75 determine the number of character positions available on one output line. If
76 this variable is not set, the \fBterminfo\fR(4) database is used to determine
77 the number of columns, based on the environment variable, \fBTERM\fR. If this
78 information cannot be obtained, 80 columns are assumed. If the \fB-w\fR option
79 is used, the argument overrides any other column width.
80 .sp
81 .LP
82 The mode printed when the \fB-e\fR, \fB-E\fR, \fB-g\fR, \fB-l\fR, \fB-n\fR,
83 \fB-o\fR, \fB-v\fR, \fB-V\fR, or \fB-@\fR option is in effect consists of
84 eleven characters. The first character can be one of the following:
85 .sp
86 .ne 2
87 .na
88 \fB\fBd\fR\fR
89 .ad
90 .sp .6
91 .RS 4n
92 The entry is a directory.
93 .RE
95 .sp
96 .ne 2
97 .na
98 \fB\fBD\fR\fR
99 .ad
100 .sp .6
101 .RS 4n
102 The entry is a door.
106 .ne 2
108 \fB\fBl\fR\fR
110 .sp .6
111 .RS 4n
112 The entry is a symbolic link.
116 .ne 2
118 \fB\fBb\fR\fR
120 .sp .6
121 .RS 4n
122 The entry is a block special file.
126 .ne 2
128 \fB\fBc\fR\fR
130 .sp .6
131 .RS 4n
132 The entry is a character special file.
136 .ne 2
138 \fB\fBp\fR\fR
140 .sp .6
141 .RS 4n
142 The entry is a \fBFIFO\fR (or "named pipe") special file.
146 .ne 2
148 \fB\fBP\fR\fR
150 .sp .6
151 .RS 4n
152 The entry is an event port.
156 .ne 2
158 \fB\fBs\fR\fR
160 .sp .6
161 .RS 4n
162 The entry is an \fBAF_UNIX\fR address family socket.
166 .ne 2
168 \fB\fB\(mi\fR\fR
170 .sp .6
171 .RS 4n
172 The entry is an ordinary file.
177 The next 9 characters are interpreted as three sets of three bits each. The
178 first set refers to the owner's permissions; the next to permissions of others
179 in the user-group of the file; and the last to all others. Within each set, the
180 three characters indicate permission to read, to write, and to execute the file
181 as a program, respectively. For a directory, \fBexecute\fR permission is
182 interpreted to mean permission to search the directory for a specified file.
183 The character after permissions is an ACL or extended attributes indicator.
184 This character is an \fB@\fR if extended attributes are associated with the
185 file and the \fB-@\fR option is in effect. Otherwise, this character is a plus
186 sign (\fB+\fR) character if a non-trivial ACL is associated with the file or a
187 space character if not.
190 If \fB-/\fR and/or \fB-%\fR are in effect, then the extended system attributes
191 are printed when filesystem supports extended system attributes. The display
192 looks as follows:
194 .in +2
196 $ls -/ c  file
197 -rw-r--r--   1 root     root           0 May 10 14:17 file
198                 {AHRSadim-u--}
200 $ls -/ v file
201 -rw-r--r--   1 root     root           0 May 10 14:17 file
202                 {archive,hidden,readonly,system,\e
203                  appendonly,nodump,immutable,av_modified,\e
204                  noav_quarantined,nounlink,nooffline,\e
205                  nosparse}
207 $ls -l -% all file
208 -rw-r--r--   1 root     root           0 May 10 14:17 file
209                 timestamp: atime    Jun 25 12:56:44 2007
210                 timestamp: ctime    May 10 14:20:23 2007
211                 timestamp: mtime    May 10 14:17:56 2007
212                 timestamp: crtime   May 10 14:17:56 2007
214 .in -2
219 See the option descriptions of the \fB-/\fR and \fB-%\fR option for details.
222 \fBls\fR \fB-l\fR (the long list) prints its output as follows for the POSIX
223 locale:
225 .in +2
227 -rwxrwxrwx+ 1 smith dev   10876  May 16 9:42 part2
229 .in -2
234 Reading from right to left, you see that the current directory holds one file,
235 named \fBpart2\fR. Next, the last time that file's contents were modified was
236 \fB9:42 A.M.\fR on \fBMay 16\fR. The file contains 10,876 characters, or bytes.
237 The owner of the file, or the user, belongs to the group \fBdev\fR (perhaps
238 indicating \fBdevelopment\fR), and his or her login name is \fBsmith\fR. The
239 number, in this case \fB1\fR, indicates the number of links to file \fBpart2\fR
240 (see \fBcp\fR(1)). The plus sign indicates that there is an \fBACL\fR
241 associated with the file. If the \fB-@\fR option has been specified, the
242 presence of extended attributes supersede the presence of an \fBACL\fR and the
243 plus sign is replaced with an 'at' sign (\fB@\fR). Finally, the dash and
244 letters tell you that user, group, and others have permissions to read, write,
245 and execute \fBpart2\fR.
248 The execute (\fBx\fR) symbol occupies the third position of the three-character
249 sequence. A \fB\(mi\fR in the third position would have indicated a denial of
250 execution permissions.
253 The permissions are indicated as follows:
255 .ne 2
257 \fB\fBr\fR\fR
259 .sp .6
260 .RS 4n
261 The file is readable.
265 .ne 2
267 \fB\fBw\fR\fR
269 .sp .6
270 .RS 4n
271 The file is writable.
275 .ne 2
277 \fB\fBx\fR\fR
279 .sp .6
280 .RS 4n
281 The file is executable.
285 .ne 2
287 \fB\fB\(mi\fR\fR
289 .sp .6
290 .RS 4n
291 The indicated permission is \fInot\fR granted.
295 .ne 2
297 \fB\fBs\fR\fR
299 .sp .6
300 .RS 4n
301 The \fBs\fRet-user-ID or \fBs\fRet-group-ID bit is on, and the corresponding
302 user or group execution bit is also on.
306 .ne 2
308 \fB\fBS\fR\fR
310 .sp .6
311 .RS 4n
312 Undefined bit-state (the set-user-ID or set-group-id bit is on and the user or
313 group execution bit is off). For group permissions, this applies only to
314 non-regular files.
318 .ne 2
320 \fB\fBt\fR\fR
322 .sp .6
323 .RS 4n
324 The 1000 (octal) bit, or sticky bit, is on (see \fBchmod\fR(1)), and execution
325 is on.
329 .ne 2
331 \fB\fBT\fR\fR
333 .sp .6
334 .RS 4n
335 The 1000 bit is turned on, and execution is off (undefined bit-state).
338 .ne 2
340 \fB\fBL\fR\fR
342 .sp .6
343 .RS 4n
344 Mandatory locking occurs during access (on a regular file, the set-group-ID bit
345 is on and the group execution bit is off).
350 For user and group permissions, the third position is sometimes occupied by a
351 character other than \fBx\fR or \fB-\fR. \fBs\fR or \fBS\fR also can occupy
352 this position, referring to the state of the set-ID bit, whether it be the
353 user's or the group's. The ability to assume the same ID as the user during
354 execution is, for example, used during login when you begin as root but need to
355 assume the identity of the user you login as.
358 In the case of the sequence of group permissions, \fBl\fR can occupy the third
359 position. \fBl\fR refers to mandatory file and record locking. This permission
360 describes a file's ability to allow other files to lock its reading or writing
361 permissions during access.
364 For others permissions, the third position can be occupied by \fBt\fR or
365 \fBT\fR. These refer to the state of the sticky bit and execution permissions.
366 .SS "Color Output"
368 If color output is enabled, the environment variable LS_COLORS is checked.  If
369 it exists, it's contents are used to control the colors used to display
370 filenames.  If it is not set, a default list of colors is used. The format of
371 LS_COLORS is a colon separated list of attribute specifications. Each attribute
372 specification is of the format
374 .in +2
376 \fIfilespec\fR=\fIattr\fR[;\fIattr\fR..]
378 .in -2
383 \fIfilespec\fR is either of the form \fI*.SUFFIX\fR, for example, \fB*.jar\fR
384 or \fB*.Z\fR, or one of the following file types:
386 .ne 2
388 \fB\fBno\fR\fR
390 .sp .6
391 .RS 4n
392 Normal file
396 .ne 2
398 \fB\fBfi\fR\fR
400 .sp .6
401 .RS 4n
402 Regular file
406 .ne 2
408 \fB\fBdi\fR\fR
410 .sp .6
411 .RS 4n
412 Directory
416 .ne 2
418 \fB\fBln\fR\fR
420 .sp .6
421 .RS 4n
422 Symbolic link
426 .ne 2
428 \fB\fBpi\fR\fR
430 .sp .6
431 .RS 4n
432 FIFO or named pipe
436 .ne 2
438 \fB\fBso\fR\fR
440 .sp .6
441 .RS 4n
442 Socket
446 .ne 2
448 \fB\fBdo\fR\fR
450 .sp .6
451 .RS 4n
452 Door file
456 .ne 2
458 \fB\fBbd\fR\fR
460 .sp .6
461 .RS 4n
462 Block device
466 .ne 2
468 \fB\fBcd\fR\fR
470 .sp .6
471 .RS 4n
472 Character device
476 .ne 2
478 \fB\fBex\fR\fR
480 .sp .6
481 .RS 4n
482 Execute bit (either \fBuser\fR, \fBgroup\fR, or \fBother\fR) set
486 .ne 2
488 \fB\fBpo\fR\fR
490 .sp .6
491 .RS 4n
492 Event port
496 .ne 2
498 \fB\fBst\fR\fR
500 .sp .6
501 .RS 4n
502 Sticky bit set
506 .ne 2
508 \fB\fBor\fR\fR
510 .sp .6
511 .RS 4n
512 Orphaned symlink
516 .ne 2
518 \fB\fBsg\fR\fR
520 .sp .6
521 .RS 4n
522 \fBsetgid\fR binary
526 .ne 2
528 \fB\fBsu\fR\fR
530 .sp .6
531 .RS 4n
532 \fBsetuid\fR binary
536 .ne 2
538 \fB\fBow\fR\fR
540 .sp .6
541 .RS 4n
542 \fBworld\fR writable
546 .ne 2
548 \fB\fBtw\fR\fR
550 .sp .6
551 .RS 4n
552 Sticky bit and \fBworld\fR writable
557 \fIattr\fR is a semicolon delimited list of color and display attributes which
558 are combined to determine the final output color. Any combination of \fIattr\fR
559 values can be specified. Possible \fIattr\fR values are:
561 .ne 2
563 \fB\fB00\fR\fR
565 .sp .6
566 .RS 4n
567 All attributes off (default terminal color)
571 .ne 2
573 \fB\fB01\fR\fR
575 .sp .6
576 .RS 4n
577 Display text in bold
581 .ne 2
583 \fB\fB04\fR\fR
585 .sp .6
586 .RS 4n
587 Display text with an underscore
591 .ne 2
593 \fB\fB05\fR\fR
595 .sp .6
596 .RS 4n
597 Display text in bold
601 .ne 2
603 \fB\fB07\fR\fR
605 .sp .6
606 .RS 4n
607 Display text with foreground and background colors reversed
611 .ne 2
613 \fB\fB08\fR\fR
615 .sp .6
616 .RS 4n
617 Display using concealed text.
622 One of the following values can be chosen. If multiple values are specified,
623 the last specified value is used.
625 .ne 2
627 \fB\fB30\fR\fR
629 .sp .6
630 .RS 4n
631 Set foreground to \fBblack\fR.
635 .ne 2
637 \fB\fB31\fR\fR
639 .sp .6
640 .RS 4n
641 Set foreground to \fBred\fR.
645 .ne 2
647 \fB\fB32\fR\fR
649 .sp .6
650 .RS 4n
651 Set foreground to \fBgreen\fR.
655 .ne 2
657 \fB\fB33\fR\fR
659 .sp .6
660 .RS 4n
661 Set foreground to \fByellow\fR.
665 .ne 2
667 \fB\fB34\fR\fR
669 .sp .6
670 .RS 4n
671 Set foreground to \fBblue\fR.
675 .ne 2
677 \fB\fB35\fR\fR
679 .sp .6
680 .RS 4n
681 Set foreground to \fBmagenta\fR (\fBpurple\fR).
683 Set foreground to \fB\fR.
687 .ne 2
689 \fB\fB36\fR\fR
691 .sp .6
692 .RS 4n
693 Set foreground to \fBcyan\fR.
697 .ne 2
699 \fB\fB37\fR\fR
701 .sp .6
702 .RS 4n
703 Set foreground to \fBwhite\fR.
707 .ne 2
709 \fB\fB39\fR\fR
711 .sp .6
712 .RS 4n
713 Set foreground to default terminal color.
718 One of the following can be specified. If multiple values are specified, the
719 last value specified is used.
721 .ne 2
723 \fB\fB40\fR\fR
725 .sp .6
726 .RS 4n
727 Set foreground to \fBblack\fR.
731 .ne 2
733 \fB\fB41\fR\fR
735 .sp .6
736 .RS 4n
737 Set foreground to \fBred\fR.
741 .ne 2
743 \fB\fB42\fR\fR
745 .sp .6
746 .RS 4n
747 Set foreground to \fBgreen\fR.
751 .ne 2
753 \fB\fB43\fR\fR
755 .sp .6
756 .RS 4n
757 Set foreground to \fByellow\fR.
761 .ne 2
763 \fB\fB44\fR\fR
765 .sp .6
766 .RS 4n
767 Set foreground to \fBblue\fR.
771 .ne 2
773 \fB\fB45\fR\fR
775 .sp .6
776 .RS 4n
777 Set foreground to \fBmagenta\fR (\fBpurple\fR).
781 .ne 2
783 \fB\fB46\fR\fR
785 .sp .6
786 .RS 4n
787 Set foreground to \fBcyan\fR.
791 .ne 2
793 \fB\fB47\fR\fR
795 .sp .6
796 .RS 4n
797 Set foreground to \fBwhite\fR.
801 .ne 2
803 \fB\fB49\fR\fR
805 .sp .6
806 .RS 4n
807 Set foreground to default terminal color.
812 On some terminals, setting the bold attribute causes the foreground colors to
813 be high-intensity, that is, brighter. In such cases the low-intensity yellow is
814 often displayed as a brown or orange color.
817 At least one attribute must be listed for a file specification.
820 The appropriate color codes are chosen by selecting the most specific match,
821 starting with the file suffixes and proceeding with the file types until a
822 match is found. The \fBno\fR (normal file) type matches any file.
823 .SH OPTIONS
825 The following options are supported:
827 The following options are supported for all three versions:
829 .ne 2
831 \fB\fB-a\fR\fR
835 \fB\fB--all\fR\fR
837 .sp .6
838 .RS 4n
839 Lists all entries, including those that begin with a dot (\fB\&.\fR), which are
840 normally not listed.
844 .ne 2
846 \fB\fB-A\fR\fR
850 \fB\fB--almost-all\fR\fR
852 .sp .6
853 .RS 4n
854 Lists all entries, including those that begin with a dot (\fB\&.\fR), with the
855 exception of the working directory (\fB\&.\fR) and the parent directory
856 (\fB\&..\fR).
860 .ne 2
862 \fB\fB-b\fR\fR
866 \fB\fB--escape\fR\fR
868 .sp .6
869 .RS 4n
870 Forces printing of non-printable characters to be in the octal
871 \fB\e\fR\fIddd\fR notation.
875 .ne 2
877 \fB\fB-B\fR\fR
881 \fB\fB--ignore-backups\fR\fR
883 .sp .6
884 .RS 4n
885 Do not display any files ending with a tilde (\fB~\fR).
889 .ne 2
891 \fB\fB-c\fR\fR
893 .sp .6
894 .RS 4n
895 Uses time of last modification of the i-node (file created, mode changed, and
896 so forth) for sorting (\fB-t\fR) or printing (\fB-l\fR or \fB-n\fR).
900 .ne 2
902 \fB\fB-C\fR\fR
904 .sp .6
905 .RS 4n
906 Multi-column output with entries sorted down the columns. This is the default
907 output format.
911 .ne 2
913 \fB\fB-d\fR\fR
915 .sp .6
916 .RS 4n
917 If an argument is a directory, lists only its name (not its contents). Often
918 used with \fB-l\fR to get the status of a directory.
922 .ne 2
924 \fB\fB-e\fR\fR
926 .sp .6
927 .RS 4n
928 The same as \fB-l\fR, except displays time to the second, and with one format
929 for all files regardless of age: \fImmm dd hh:mm:ss yyyy\fR.
933 .ne 2
935 \fB\fB-E\fR\fR
937 .sp .6
938 .RS 4n
939 The same as \fB-l\fR, except displays time to the nanosecond and with one
940 format for all files regardless of age: \fIyyyy-mm-dd hh:mm:ss.nnnnnnnnn\fR
941 (ISO 8601:2000 format).
943 In addition, this option displays the offset from UTC in ISO 8601:2000 standard
944 format (+\fIhhmm\fR or -\fIhhmm\fR) or no characters if the offset is
945 indeterminable. The offset reflects the appropriate standard or alternate
946 offset in force at the file's displayed date and time, under the current
947 timezone.
951 .ne 2
953 \fB\fB-f\fR\fR
955 .sp .6
956 .RS 4n
957 Forces each argument to be interpreted as a directory and list the name found
958 in each slot. This option turns off \fB-l\fR, \fB-t\fR, \fB-s\fR, \fB-S\fR, and
959 \fB-r\fR, and turns on \fB-a\fR. The order is the order in which entries appear
960 in the directory.
964 .ne 2
966 \fB\fB-F\fR\fR
970 \fB\fB--classify\fR\fR
972 .sp .6
973 .RS 4n
974 Append a symbol after certain types of files to indicate the file type. The
975 following symbols are used:
977 .ne 2
979 \fB\fB/\fR\fR
981 .sp .6
982 .RS 4n
983 Directory
987 .ne 2
989 \fB\fB>\fR\fR
991 .sp .6
992 .RS 4n
993 Door file
997 .ne 2
999 \fB\fB|\fR\fR
1001 .sp .6
1002 .RS 4n
1003 Named pipe (\fBFIFO\fR)
1007 .ne 2
1009 \fB\fB@\fR\fR
1011 .sp .6
1012 .RS 4n
1013 Symbolic link
1017 .ne 2
1019 \fB\fB=\fR\fR
1021 .sp .6
1022 .RS 4n
1023 Socket
1027 .ne 2
1029 \fB\fB*\fR\fR
1031 .sp .6
1032 .RS 4n
1033 Executable
1039 .ne 2
1041 \fB\fB-g\fR\fR
1043 .sp .6
1044 .RS 4n
1045 The same as \fB-l\fR, except that the owner is not printed.
1049 .ne 2
1051 \fB\fB-h\fR\fR
1055 \fB\fB--human-readable\fR\fR
1057 .sp .6
1058 .RS 4n
1059 All sizes are scaled to a human readable format, for example, \fB14K\fR,
1060 \fB234M\fR, \fB2.7G\fR, or \fB3.0T\fR. Scaling is done by repetitively dividing
1061 by \fB1024\fR. The last --si or -h option determines the divisor used.
1065 .ne 2
1067 \fB\fB-H\fR\fR
1071 \fB\fB--dereference-command-line\fR\fR
1073 .sp .6
1074 .RS 4n
1075 If an argument is a symbolic link that references a directory, this option
1076 evaluates the file information and file type of the directory that the link
1077 references, rather than those of the link itself. However, the name of the link
1078 is displayed, rather than the referenced directory.
1082 .ne 2
1084 \fB\fB-i\fR\fR
1088 \fB\fB--inode\fR\fR
1090 .sp .6
1091 .RS 4n
1092 For each file, prints the i-node number in the first column of the report.
1096 .ne 2
1098 \fB\fB-k\fR\fR
1100 .sp .6
1101 .RS 4n
1102 All sizes are printed in kbytes. Equivalent to --block-size=1024.
1106 .ne 2
1108 \fB\fB-l\fR\fR
1110 .sp .6
1111 .RS 4n
1112 Lists in long format, giving mode, \fBACL\fR indication, number of links,
1113 owner, group, size in bytes, and time of last modification for each file (see
1114 above). If the file is a special file, the size field instead contains the
1115 major and minor device numbers. If the time of last modification is greater
1116 than six months ago, it is shown in the format `month date year' for the POSIX
1117 locale. When the \fBLC_TIME\fR locale category is not set to the POSIX locale,
1118 a different format of the time field can be used. Files modified within six
1119 months show `month date time'. If the file is a symbolic link, the filename is
1120 printed followed by "\fB\(->\fR" and the path name of the referenced file.
1124 .ne 2
1126 \fB\fB-L\fR\fR
1130 \fB\fB--dereference\fR\fR
1132 .sp .6
1133 .RS 4n
1134 If an argument is a symbolic link, this option evaluates the file information
1135 and file type of the file or directory that the link references, rather than
1136 those of the link itself. However, the name of the link is displayed, rather
1137 than the referenced file or directory.
1141 .ne 2
1143 \fB\fB-m\fR\fR
1145 .sp .6
1146 .RS 4n
1147 Streams output format. Files are listed across the page, separated by commas.
1151 .ne 2
1153 \fB\fB-n\fR\fR
1157 \fB\fB--numeric-uid-gid\fR\fR
1159 .sp .6
1160 .RS 4n
1161 The same as \fB-l\fR, except that the owner's \fBUID\fR and group's \fBGID\fR
1162 numbers are printed, rather than the associated character strings.
1166 .ne 2
1168 \fB\fB-o\fR\fR
1172 \fB\fB--no-group\fR\fR
1174 .sp .6
1175 .RS 4n
1176 The same as \fB-l\fR, except that the group is not printed.
1180 .ne 2
1182 \fB\fB-p\fR\fR
1184 .sp .6
1185 .RS 4n
1186 Puts a slash (\fB/\fR) after each filename if the file is a directory.
1190 .ne 2
1192 \fB\fB-q\fR\fR
1196 \fB\fB--hide-control-chars\fR\fR
1198 .sp .6
1199 .RS 4n
1200 Forces printing of non-printable characters in file names as the character
1201 question mark (\fB?\fR).
1205 .ne 2
1207 \fB\fB-r\fR\fR
1211 \fB\fB--reverse\fR\fR
1213 .sp .6
1214 .RS 4n
1215 Reverses the order of sort to get reverse alphabetic, oldest first, or smallest
1216 file size first as appropriate.
1220 .ne 2
1222 \fB\fB-R\fR\fR
1226 \fB\fB--recursive\fR\fR
1228 .sp .6
1229 .RS 4n
1230 Recursively lists subdirectories encountered.
1234 .ne 2
1236 \fB\fB-s\fR\fR
1240 \fB\fB--size\fR\fR
1242 .sp .6
1243 .RS 4n
1244 Indicate the total number of file system blocks consumed by each file
1245 displayed.
1249 .ne 2
1251 \fB\fB-S\fR\fR
1253 .sp .6
1254 .RS 4n
1255 Sort by file size (in decreasing order) and for files with the same size by
1256 file name (in increasing alphabetic order) instead of just by name.
1260 .ne 2
1262 \fB\fB-t\fR\fR
1264 .sp .6
1265 .RS 4n
1266 Sorts by time stamp (latest first) instead of by name. The default is the last
1267 modification time. See \fB-c\fR, \fB-u\fR and \fB-%\fR.
1271 .ne 2
1273 \fB\fB-u\fR\fR
1275 .sp .6
1276 .RS 4n
1277 Uses time of last access instead of last modification for sorting (with the
1278 \fB-t\fR option) or printing (with the \fB-l\fR option).
1282 .ne 2
1284 \fB\fB-U\fR\fR
1286 .sp .6
1287 .RS 4n
1288 Output is unsorted.
1292 .ne 2
1294 \fB\fB-v\fR\fR
1296 .sp .6
1297 .RS 4n
1298 The same as \fB-l\fR, except that verbose ACL information is displayed as well
1299 as the \fB-l\fR output. ACL information is displayed even if the file or
1300 directory doesn't have an ACL.
1304 .ne 2
1306 \fB\fB-V\fR\fR
1308 .sp .6
1309 .RS 4n
1310 The same as \fB-l\fR, except that compact ACL information is displayed after
1311 the \fB-l\fR output.
1313 The \fB-V\fR option is only applicable to file systems that support NFSv4 ACLs,
1314 such as the Solaris ZFS file system.
1316 The format of the displayed ACL is as follows:
1318 .in +2
1320 \fIentry_type\fR : \fIpermissions\fR : \fIinheritance_flags\fR : \fIaccess_type\fR
1322 .in -2
1325 \fIentry_type\fR is displayed as one of the following:
1327 .ne 2
1329 \fBuser:\fIusername\fR\fR
1331 .sp .6
1332 .RS 4n
1333 Additional user access for \fIusername\fR.
1337 .ne 2
1339 \fBgroup:\fIgroupname\fR\fR
1341 .sp .6
1342 .RS 4n
1343 Additional group access for group \fIgroupname\fR.
1347 .ne 2
1349 \fBowner@\fR
1351 .sp .6
1352 .RS 4n
1353 File owner.
1357 .ne 2
1359 \fBgroup@\fR
1361 .sp .6
1362 .RS 4n
1363 File group owner.
1367 .ne 2
1369 \fBeveryone@\fR
1371 .sp .6
1372 .RS 4n
1373 Everyone access, including file owner and file group owner. This is not
1374 equivalent to the POSIX other class.
1377 The following permissions, supported by the NFSv4 ACL model, are displayed by
1378 using the \fB-v\fR or \fB-V\fR options:
1380 .ne 2
1382 \fBread_data (\fBr\fR)\fR
1384 .sp .6
1385 .RS 4n
1386 Permission to read the data of a file.
1390 .ne 2
1392 \fBlist_directory (\fBr\fR)\fR
1394 .sp .6
1395 .RS 4n
1396 Permission to list the contents of a directory.
1400 .ne 2
1402 \fBwrite_data (\fBw\fR)\fR
1404 .sp .6
1405 .RS 4n
1406 Permission to modify a file's data. anywhere in the file's offset range.
1410 .ne 2
1412 \fBadd_file (\fBw\fR)\fR
1414 .sp .6
1415 .RS 4n
1416 Permission to add a new file to a directory.
1420 .ne 2
1422 \fBappend_data (\fBp\fR)\fR
1424 .sp .6
1425 .RS 4n
1426 The ability to modify a file's data, but only starting at EOF.
1430 .ne 2
1432 \fBadd_subdirectory (\fBp\fR)\fR
1434 .sp .6
1435 .RS 4n
1436 Permission to create a subdirectory to a directory.
1440 .ne 2
1442 \fBread_xattr (\fBR\fR)\fR
1444 .sp .6
1445 .RS 4n
1446 Ability to read the extended attributes of a file.
1450 .ne 2
1452 \fBwrite_xattr (\fBW\fR)\fR
1454 .sp .6
1455 .RS 4n
1456 Ability to create extended attributes or write to the extended attribute
1457 directory.
1461 .ne 2
1463 \fBexecute (\fBx\fR)\fR
1465 .sp .6
1466 .RS 4n
1467 Permission to execute a file.
1471 .ne 2
1473 \fBread_attributes (\fBa\fR)\fR
1475 .sp .6
1476 .RS 4n
1477 The ability to read basic attributes (non-ACLs) of a file.
1481 .ne 2
1483 \fBwrite_attributes (\fBA\fR)\fR
1485 .sp .6
1486 .RS 4n
1487 Permission to change the times associated with a file or directory to an
1488 arbitrary value.
1492 .ne 2
1494 \fBdelete (\fBd\fR)\fR
1496 .sp .6
1497 .RS 4n
1498 Permission to delete a file.
1502 .ne 2
1504 \fBdelete_child (\fBD\fR)\fR
1506 .sp .6
1507 .RS 4n
1508 Permission to delete a file within a directory.
1512 .ne 2
1514 \fBread_acl (\fBc\fR)\fR
1516 .sp .6
1517 .RS 4n
1518 Permission to read the ACL of a file.
1522 .ne 2
1524 \fBwrite_acl (\fBC\fR)\fR
1526 .sp .6
1527 .RS 4n
1528 Permission to write the ACL of a file.
1532 .ne 2
1534 \fBwrite_owner (\fBo\fR)\fR
1536 .sp .6
1537 .RS 4n
1538 Permission to change the owner of a file.
1542 .ne 2
1544 \fBsynchronize (\fBs\fR)\fR
1546 .sp .6
1547 .RS 4n
1548 Permission to access file locally at server with synchronize reads and writes.
1552 .ne 2
1554 \fB\fB-\fR\fR
1556 .sp .6
1557 .RS 4n
1558 No permission granted
1561 The following inheritance flags, supported by the NFSv4 ACL model, are
1562 displayed by using the \fB-v\fR or \fB-V\fR options:
1564 .ne 2
1566 \fBfile_inherit (\fBf\fR)\fR
1568 .sp .6
1569 .RS 4n
1570 Inherit to all newly created files.
1574 .ne 2
1576 \fBdir_inherit (\fBd\fR)\fR
1578 .sp .6
1579 .RS 4n
1580 Inherit to all newly created directories.
1584 .ne 2
1586 \fBinherit_only (\fBi\fR)\fR
1588 .sp .6
1589 .RS 4n
1590 When placed on a directory, do not apply to the directory, only to newly
1591 created files and directories. This flag requires that either
1592 \fBfile_inherit\fR and or \fBdir_inherit\fR is also specified.
1596 .ne 2
1598 \fBno_propagate (\fBn\fR)\fR
1600 .sp .6
1601 .RS 4n
1602 Indicates that ACL entries should be inherited to objects in a directory, but
1603 inheritance should stop after descending one level. This flag is dependent upon
1604 either \fBfile_inherit\fR and or \fBdir_inherit\fR also being specified.
1608 .ne 2
1610 \fBsuccessful_access (\fBS\fR)\fR
1612 .sp .6
1613 .RS 4n
1614 Indicates whether an alarm or audit record should be initiated upon successful
1615 accesses. Used with audit/alarm ACE types.
1619 .ne 2
1621 \fBfailed_access (\fBF\fR)\fR
1623 .sp .6
1624 .RS 4n
1625 Indicates whether an alarm or audit record should be initiated when access
1626 fails. Used with audit/alarm ACE types.
1630 .ne 2
1632 \fBinherited (\fBI\fR)\fR
1634 .sp .6
1635 .RS 4n
1636 ACE was inherited.
1640 .ne 2
1642 \fB\fB-\fR\fR
1644 .sp .6
1645 .RS 4n
1646 No permission granted.
1649 \fIaccess_type\fR is displayed as one of the following types:
1651 .ne 2
1653 \fBalarm\fR
1655 .RS 9n
1656 Permission field that specifies permissions that should trigger an alarm.
1660 .ne 2
1662 \fBallow\fR
1664 .RS 9n
1665 Permission field that specifies allow permissions.
1669 .ne 2
1671 \fBaudit\fR
1673 .RS 9n
1674 Permission field that specifies permissions that should be audited.
1678 .ne 2
1680 \fBdeny\fR
1682 .RS 9n
1683 Permission field that specifies deny permissions.
1686 For example:
1688 .in +2
1690 $ ls -dV /sandbox/dir.1
1691   drwxr-xr-x+  2 root     root           2 Jan 17 15:09 dir.1
1692                   user:marks:r-------------:fd-----:allow
1693                       owner@:--------------:-------:deny
1694                       owner@:rwxp---A-W-Co-:-------:allow
1695                       group@:-w-p----------:-------:deny
1696                       group@:r-x-----------:-------:allow
1697                    everyone@:-w-p---A-W-Co-:-------:deny
1698                    everyone@:r-x---a-R-c--s:-------:allow
1700                            ||||||||||||||||:||||||+ inherited access
1701                              ||||||||||||||:||||||+ failed access
1702                              ||||||||||||||:|||||+--success access
1703                              ||||||||||||||:||||+-- no propagate
1704                              ||||||||||||||:|||+--- inherit only
1705                              ||||||||||||||:||+---- directory inherit
1706                              ||||||||||||||:|+----- file inherit
1707                              ||||||||||||||
1708                              ||||||||||||||+ sync
1709                              |||||||||||||+- change owner
1710                              ||||||||||||+-- write ACL
1711                              |||||||||||+--- read ACL
1712                              ||||||||||+---- write extended attributes
1713                              |||||||||+----- read extended attributes
1714                              ||||||||+------ write attributes
1715                              |||||||+------- read attributes
1716                              ||||||+-------- delete child
1717                              |||||+--------- delete
1718                              ||||+---------- append
1719                              |||+----------- execute
1720                              ||+------------ write data
1721                              |+------------- read data
1723 .in -2
1729 .ne 2
1731 \fB\fB-w\fR \fIcols\fR\fR
1735 \fB\fB--width\fR \fIcols\fR\fR
1737 .sp .6
1738 .RS 4n
1739 Multi-column output where the column width is forced to \fIcols\fR.
1743 .ne 2
1745 \fB\fB-x\fR\fR
1747 .sp .6
1748 .RS 4n
1749 Multi-column output with entries sorted across rather than down the page.
1753 .ne 2
1755 \fB\fB-1\fR\fR
1757 .sp .6
1758 .RS 4n
1759 Prints one entry per line of output.
1763 .ne 2
1765 \fB\fB-@\fR\fR
1767 .sp .6
1768 .RS 4n
1769 The same as \fB-l\fR, except that extended attribute information overrides
1770 \fBACL\fR information. An \fB@\fR is displayed after the file permission bits
1771 for files that have extended attributes.
1775 .ne 2
1777 \fB\fB-/ c\fR | \fBv\fR\fR
1779 .sp .6
1780 .RS 4n
1781 The same as \fB-l\fR, and in addition displays the extended system attributes
1782 associated with the file when extended system attributes are fully supported by
1783 the underlying file system. The option \fB-/\fR supports two option arguments
1784 \fBc\fR (compact mode) and \fBv\fR (verbose mode).
1786 .ne 2
1788 \fB\fBappendonly\fR\fR
1790 .sp .6
1791 .RS 4n
1792 Allows a file to be modified only at offset \fBEOF\fR. Attempts to modify a
1793 file at a location other than \fBEOF\fR fails with \fBEPERM\fR.
1797 .ne 2
1799 \fB\fBarchive\fR\fR
1801 .sp .6
1802 .RS 4n
1803 Indicates if a file has been modified since it was last backed up. Whenever the
1804 modification time (\fBmtime\fR) of a file is changed the \fBarchive\fR
1805 attribute is set.
1809 .ne 2
1811 \fB\fBav_modified\fR\fR
1813 .sp .6
1814 .RS 4n
1815 ZFS sets the anti-virus attribute which whenever a file's content or size
1816 changes or when the file is renamed.
1820 .ne 2
1822 \fB\fBav_quarantined\fR\fR
1824 .sp .6
1825 .RS 4n
1826 Anti-virus software sets to mark a file as quarantined.
1830 .ne 2
1832 \fB\fBcrtime\fR\fR
1834 .sp .6
1835 .RS 4n
1836 Timestamp when a file is created.
1840 .ne 2
1842 \fB\fBhidden\fR\fR
1844 .sp .6
1845 .RS 4n
1846 Marks a file as hidden.
1850 .ne 2
1852 \fB\fBimmutable\fR\fR
1854 .sp .6
1855 .RS 4n
1856 Prevents the content of a file from being modified. Also prevents all metadata
1857 changes, except for access time updates. When placed on a directory, prevents
1858 the deletion and creation of files in the directories. Attempts to modify the
1859 content of a file or directory marked as \fBimmutable\fR fail with \fBEPERM\fR.
1860 Attempts to modify any attributes (with the exception of access time and, with
1861 the proper privileges, the \fBimmutable\fR) of a file marked as \fBimmutable\fR
1862 fails with \fBEPERM\fR.
1866 .ne 2
1868 \fB\fBnodump\fR\fR
1870 .sp .6
1871 .RS 4n
1872 Solaris systems have no special semantics for this attribute.
1876 .ne 2
1878 \fB\fBnounlink\fR\fR
1880 .sp .6
1881 .RS 4n
1882 Prevents a file from being deleted. On a directory, the attribute also prevents
1883 any changes to the contents of the directory. That is, no files within the
1884 directory can be removed or renamed. The \fBerrno\fR \fBEPERM\fR is returned
1885 when attempting to unlink or rename files and directories that are marked as
1886 \fBnounlink\fR.
1890 .ne 2
1892 \fB\fBoffline\fR\fR
1894 .sp .6
1895 .RS 4n
1896 Indicate that a file is offline.  Solaris systems have no special semantics for
1897 this attribute.
1901 .ne 2
1903 \fB\fBreadonly\fR\fR
1905 .sp .6
1906 .RS 4n
1907 Marks a file as \fBreadonly\fR. Once a file is marked as \fBreadonly\fR the
1908 content data of the file cannot be modified. Other metadata for the file can
1909 still be modified.
1913 .ne 2
1915 \fB\fBsparse\fR\fR
1917 .sp .6
1918 .RS 4n
1919 Indicate that a file can be interpreted as sparse.  It does not indicate that
1920 the file is actually sparse or not.  The sparse attribute is cleared when the
1921 file is truncated to zero length.  Solaris systems have no other special
1922 semantics for this attribute.
1926 .ne 2
1928 \fB\fBsystem\fR\fR
1930 .sp .6
1931 .RS 4n
1932 Solaris systems have no special semantics for this attribute.
1939 The display characters used in compact mode (\fB-/ c\fR) are as follows:
1941 .in +2
1943 Attribute Name     Display
1944 archive            A
1945 hidden             H
1946 readonly           R
1947 system             S
1948 appendonly         a
1949 nodump             d
1950 immutable          i
1951 av_modified        m
1952 av_quarantined     q
1953 nounlink           u
1954 offline            O
1955 sparse             s
1957 .in -2
1962 The display in verbose mode (\fB-/ v\fR) uses full attribute names when it is set and
1963 the name prefixed by 'no' when it is not set.
1966 The attribute name \fBcrtime\fR and all other timestamps are handled by the
1967 option \fB-%\fR with the respective timestamp option arguments and also with
1968 \fBall\fR option argument. The display positions are as follows: The display in
1969 verbose mode (\fB-/ v\fR) uses full attribute names  when it is set and the
1970 name prefixed by \fBno\fR when it is not set. The attribute name \fBcrtime\fR
1971 and all other timestamps are handled by the option \fB-%\fR with the respective
1972 timestamp option arguments and also with \fBall\fR option argument.
1975 The display positions are as follows:
1977 .in +2
1979 {||||||||||||}
1980  |||||||||||+- s (sparse)
1981  ||||||||||+-- O (offline)
1982  |||||||||+--- u (nounlink)
1983  ||||||||+---- q (av_quarantined)
1984  |||||||+----- m (av_modified)
1985  ||||||+------ i (immutable)
1986  |||||+------- d (nodump)
1987  ||||+-------- a (appendonly)
1988  |||+--------- S (system)
1989  ||+---------- R (readonly)
1990  |+----------- H (hidden)
1991  +------------ A (archive)
1993 .in -2
1997 .in +2
1999 -% atime | crtime | ctime | mtime | all
2001 .in -2
2005 .ne 2
2007 \fB\fBatime\fR\fR
2009 .sp .6
2010 .RS 4n
2011 Equivalent to \fB-u\fR.
2015 .ne 2
2017 \fB\fBcrtime\fR\fR
2019 .sp .6
2020 .RS 4n
2021 Uses the creation time of the file for sorting or printing.
2025 .ne 2
2027 \fB\fBctime\fR\fR
2029 .sp .6
2030 .RS 4n
2031 Equivalent to \fB-c\fR.
2035 .ne 2
2037 \fB\fBmtime\fR\fR
2039 .sp .6
2040 .RS 4n
2041 Uses the last modification time of the file contents for sorting or printing.
2046 If extended system attributes are not supported or if the user does not have
2047 \fBread\fR permission on the file or if the \fBcrtime\fR extended attribute is
2048 not set, \fBcrtime\fR is treated as a synonym for \fBmtime\fR.
2051 When option argument \fBall\fR is specified, all available timestamps are
2052 printed which includes \fBatime\fR, \fBctime\fR, \fBmtime\fR and on the
2053 extended system attribute supporting file systems, \fBcrtime\fR (create time).
2054 The option \fB-% all\fR does not effect which timestamp is displayed in long
2055 format and does not affect sorting.
2057 .ne 2
2059 \fB\fB--block-size\fR \fIsize\fR\fR
2061 .sp .6
2062 .RS 4n
2063 Display sizes in multiples of size. Size can be scaled by suffixing one of
2064 \fBYyZzEePpTtGgMmKk\fR. Additionally, a \fBB\fR can be placed at the end to
2065 indicate powers of 10 instead of 2. For example, . \fB10mB\fR means blocks of
2066 \fB10000000\fR bytes while \fB10m\fR means blocks of \fB10*2^20 -- 10485760
2067 --\fR bytes. This is mutually exclusive with the \fB-h\fR option.
2071 .ne 2
2073 \fB\fB--color\fR \fB[=\fR\fIwhen\fR\fB]\fR\fR
2077 \fB\fB--colour\fR\fB[=\fR\fIwhen\fR\fB]\fR\fR
2079 .sp .6
2080 .RS 4n
2081 Display filenames using color on color-capable terminals. \fIwhen\fR is an
2082 optional argument that determines when to display color output.
2084 Possible values for \fIwhen\fR are:
2086 .ne 2
2088 \fB\fBalways\fR\fR
2092 \fB\fByes\fR\fR
2096 \fB\fBforce\fR\fR
2098 .sp .6
2099 .RS 4n
2100 Always use color.
2104 .ne 2
2106 \fB\fBauto\fR\fR
2110 \fB\fBtty\fR\fR
2114 \fB\fBif-tty\fR\fR
2116 .sp .6
2117 .RS 4n
2118 Use color if a terminal is present.
2122 .ne 2
2124 \fB\fBno\fR\fR
2128 \fB\fBnever\fR\fR
2132 \fB\fBnone\fR\fR
2134 .sp .6
2135 .RS 4n
2136 Never use color. This is the default
2139 See \fBCOLOR OUTPUT\fR for information on how to control the output colors.
2143 .ne 2
2145 \fB\fB--file-type\fR\fR
2147 .sp .6
2148 .RS 4n
2149 Display a suffix after a file depending on it's type, similar to the \fB-F\fR
2150 option, except \fB*\fR is not appended to executable files.
2154 .ne 2
2156 \fB\fB-si\fR\fR
2160 \fB\fB--\fR\fR
2162 .sp .6
2163 .RS 4n
2164 Display human scaled sizes similar to the \fB-h\fR option, except values are
2165 repeatedly divided by 1000 instead of 1024. The last option \fB--si\fR or
2166 \fB-h\fR determines the divisor used.
2170 .ne 2
2172 \fB\fB--time-style\fR style\fR
2174 .sp .6
2175 .RS 4n
2176 Display times using the specified style. This does not effect the times
2177 displayed for extended attributes (\fB-%\fR).
2179 Possible values for \fIstyle\fR are:
2181 .ne 2
2183 \fB\fBfull-iso\fR\fR
2185 .sp .6
2186 .RS 4n
2187 Equivalent to \fB-E\fR.
2191 .ne 2
2193 \fB\fBlong-iso\fR\fR
2195 .sp .6
2196 .RS 4n
2197 Display in \fIYYYY-MM-DD HH:MM\fR for all files.
2201 .ne 2
2203 \fB\fBiso\fR\fR
2205 .sp .6
2206 .RS 4n
2207 Display older files using \fIYYYY-MM-DD\fR and newer files with \fIMM-DD
2208 HH:MM\fR.
2212 .ne 2
2214 \fB\fBlocale\fR\fR
2216 .sp .6
2217 .RS 4n
2218 Use the default locale format for old and new files. This is the default.
2222 .ne 2
2224 \fB\fB+FORMAT\fR\fR
2226 .sp .6
2227 .RS 4n
2228 Use a custom format. Values are the same as described in \fBstrftime\fR(3C). If
2229 a NEWLINE appears in the string, the first line is used for older files and the
2230 second line is used for newer files. Otherwise, the given format is used for
2231 all files.
2236 .ne 2
2238 \fB\fB-F\fR\fR
2240 .sp .6
2241 .RS 4n
2242 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2243 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2244 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2245 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2246 with a trailing equals sign (\fB=\fR). Does not follow symlinks named as
2247 operands unless the \fB-H\fR or \fB-L\fR option is specified.
2251 .ne 2
2253 \fB\fB--file-type\fR\fR
2255 .sp .6
2256 .RS 4n
2257 Marks entries as with \fB-F\fR with the exception of executable files.
2258 Executable files are not marked. Does not follow symlinks named as operands
2259 unless the \fB-H\fR or \fB-L\fR option is specified.
2264 Specifying more than one of the options in the following mutually exclusive
2265 pairs is not considered an error: \fB-C\fR and \fB-l\fR (ell), m and
2266 \fB-l\fR(ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR (ell),
2267 \fB-C\fR and \fB-1\fR (one), \fB-H\fR and -\fB-L\fR, \fB-c\fR and \fB-u\fR,
2268 \fB-e\fR and \fB-E\fR, \fB-t\fR and \fB-S\fR and \fB-U\fR. The last option
2269 specifying a specific timestamp (\fB-c\fR, \fB-u\fR, \fB-% atime\fR , \fB-%
2270 crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR) determines the timestamps used
2271 for sorting or in long format listings. The last \fB-t\fR, \fB-S\fR, or
2272 \fB-U\fR option determines the sorting behavior.
2273 .SH OPERANDS
2275 The following operand is supported:
2277 .ne 2
2279 \fB\fIfile\fR\fR
2281 .sp .6
2282 .RS 4n
2283 A path name of a file to be written. If the file specified is not found, a
2284 diagnostic message is output on standard error.
2287 .SH EXAMPLES
2289 \fBExample 1 \fRViewing File Permissions
2292 The following example shows how to display detailed information about a file.
2295 .in +2
2297 % ls -l file.1
2298 -rw-r--r--   1 gozer    staff     206663 Mar 14 10:15 file.1
2300 .in -2
2305 The permissions string above (\fB-rw-r--r--\fR) describes that the file owner
2306 has read and write permissions, the owning group has read permissions, and
2307 others have read permissions.
2311 The following example shows how to display detailed information about a
2312 directory.
2315 .in +2
2317 % ls -ld test.dir
2318 drwxr-xr-x   2 gozer    staff          2 Mar 14 10:17 test.dir
2320 .in -2
2325 The permissions string above (\fBdrwxr-xr-x\fR) describes that the directory
2326 owner has read, write, and search permissions, the owning group has read and
2327 search permissions, and others have read and search permissions.
2331 Another example of listing file permissions is as follows:
2334 .in +2
2336 % ls -l file.2
2337 -rw-rwl---   1 gozer    staff     206663 Mar 14 10:47 file.2
2339 .in -2
2344 The permissions string above (\fB-rw-rwl---\fR) describes that the file owner
2345 has read and write permissions, the owning group has read and write
2346 permissions, and the file can be locked during access.
2349 \fBExample 2 \fRDisplaying ACL Information on Files and Directories
2352 The following example shows how to display verbose ACL information on a ZFS
2353 file.
2356 .in +2
2358 % ls -v file.1
2359 -rw-r--r--   1 marks    staff     206663 Mar 14 10:15 file.1
2360      0:owner@:execute:deny
2361      1:owner@:read_data/write_data/append_data/write_xattr/write_attributes
2362           /write_acl/write_owner:allow
2363      2:group@:write_data/append_data/execute:deny
2364      3:group@:read_data:allow
2365      4:everyone@:write_data/append_data/write_xattr/execute/write_attributes
2366           /write_acl/write_owner:deny
2367      5:everyone@:read_data/read_xattr/read_attributes/read_acl/synchronize
2368           :allow
2370 .in -2
2375 The following example shows how to display compact ACL information on a ZFS
2376 directory.
2379 .in +2
2381 % ls -dV test.dir
2382 drwxr-xr-x   2 marks    staff          2 Mar 14 10:17 test.dir
2383             owner@:--------------:------:deny
2384             owner@:rwxp---A-W-Co-:------:allow
2385             group@:-w-p----------:------:deny
2386             group@:r-x-----------:------:allow
2387             everyone@:-w-p---A-W-Co-:------:deny
2388             everyone@:r-x---a-R-c--s:------:allow
2390 .in -2
2395 The following example illustrates the \fBls\fR \fB-v\fR behavior when listing
2396 ACL  information on a UFS file.
2399 .in +2
2401 $ ls -v file.3
2402 -rw-r--r--   1 root     root        2703 Mar 14 10:59 file.3
2403      0:user::rw-
2404      1:group::r--               #effective:r--
2405      2:mask:r--
2406      3:other:r--
2408 .in -2
2412 \fBExample 3 \fRPrinting the Names of All Files
2415 The following example prints the names of all files in the current directory,
2416 including those that begin with a dot (\fB\&.\fR), which normally do not print:
2419 .in +2
2421 example% \fBls -a\fR
2423 .in -2
2427 \fBExample 4 \fRProviding File Information
2430 The following example provides file information:
2433 .in +2
2435 example% ls -aisn
2437 .in -2
2442 This command provides information on \fBa\fRll files, including those that
2443 begin with a dot (\fBa\fR), the \fBi\fR-number, the memory address of the
2444 i-node associated with the file\(emprinted in the left-hand column (\fBi\fR);
2445 the \fBs\fRize (in blocks) of the files, printed in the column to the right of
2446 the i-numbers (\fBs\fR); finally, the report is displayed in the \fBn\fRumeric
2447 version of the long list, printing the \fBUID\fR (instead of user name) and
2448 \fBGID\fR (instead of group name) numbers associated with the files.
2452 When the sizes of the files in a directory are listed, a total count of blocks,
2453 including indirect blocks, is printed.
2456 \fBExample 5 \fRProviding Extended System Attributes Information
2458 .in +2
2460 example% ls -/ c file    (extended system attribute in compact mode)
2461 -rw-r--r--   1 root     root           0 May 10 14:17 file
2462                          {AHRSadim-u--}
2464 .in -2
2469 In this example, \fBav_quarantined\fR, \fBoffline\fR, and \fBsparse\fR
2470 are not set.
2472 .in +2
2474 example% ls -/ v file (extended system attribute in verbose mode)
2475 -rw-r--r--   1 root     root           0 May 10 14:17 file
2476                 {archive,hidden,readonly,system,\e
2477                  appendonly,nodump,immutable,av_modified,\e
2478                  noav_quarantined,nounlink,nooffline,\e
2479                  nosparse}
2481 example% ls -/ v file     (no extended system attribute)
2482 -rw-r--r--  1 root    staff        0 May 16 14:48 file
2483                {}
2485 example% ls -/ c file        (extended system attribute
2486                               supported file system)
2488 -rw-r--r--  1 root staff        3 Jun  4 22:04 file
2489                {A------m----}
2491 .in -2
2496 \fBarchive\fR and \fBav_modified\fR attributes are set by default on  an
2497 extended system attribute supported file.
2499 .in +2
2501 example% ls -/ c  -%crtime file
2503 -rw-r--r--    root     root          0 May 10 14:17 file
2504                {AHRSadim-u--}
2506 .in -2
2511 This example displays the timestamp as the creation time:
2513 .in +2
2515 example% ls -l -%all file
2516 -rw-r--r--   1 root     root           0 May 10 14:17    file
2517                 timestamp: atime    Jun 14 08:47:37 2007
2518                 timestamp: ctime    May 10 14:20:23 2007
2519                 timestamp: mtime    May 10 14:17:56 2007
2520                 timestamp: crtime   May 10 14:17:56 2007
2522 example% ls -%crtime -tl file*
2524 -rw-r--r--   1 foo      staff          3 Jun  4 22:04 file1
2525 -rw-r--r--   1 root     root           0 May 10 14:17 file
2526 -rw-r--r--   1 foo      staff          0 May  9 13:49 file.1
2528 .in -2
2533 In this example the files are sorted by creation time.
2534 .SH ENVIRONMENT VARIABLES
2536 See \fBenviron\fR(5) for descriptions of the following environment variables
2537 that affect the execution of \fBls\fR: \fBLANG\fR, \fBLC_ALL\fR,
2538 \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_TIME\fR, \fBLC_MESSAGES\fR,
2539 \fBNLSPATH\fR, and \fBTZ\fR.
2541 .ne 2
2543 \fB\fBCOLUMNS\fR\fR
2545 .sp .6
2546 .RS 4n
2547 Determines the user's preferred column position width for writing multiple
2548 text-column output. If this variable contains a string representing a decimal
2549 integer, the \fBls\fR utility calculates how many path name text columns to
2550 write (see \fB-C\fR) based on the width provided. If \fBCOLUMNS\fR is not set
2551 or is invalid, 80 is used. The column width chosen to write the names of files
2552 in any given directory is constant. File names are not be truncated to fit into
2553 the multiple text-column output.
2557 .ne 2
2559 \fB\fBLS_COLORS\fR\fR
2561 .sp .6
2562 .RS 4n
2563 Determines the coloring scheme used when displaying color output. If not set
2564 and color output is specified, a default scheme is used. If TERM is not set, no
2565 color output is used.
2569 .ne 2
2571 \fB\fBTERM\fR\fR
2573 .sp .6
2574 .RS 4n
2575 Determine the terminal type. If this variable is unset or NULL, no color output
2576 is generated regardless of the value of the --color option.
2579 .SH EXIT STATUS
2580 .ne 2
2582 \fB\fB0\fR\fR
2584 .RS 6n
2585 All information was written successfully.
2589 .ne 2
2591 \fB\fB>0\fR\fR
2593 .RS 6n
2594 An error occurred.
2597 .SH FILES
2598 .ne 2
2600 \fB\fB/etc/group\fR\fR
2602 .sp .6
2603 .RS 4n
2604 group IDs for \fBls\fR \fB-l\fR and \fBls\fR \fB-g\fR
2608 .ne 2
2610 \fB\fB/etc/passwd\fR\fR
2612 .sp .6
2613 .RS 4n
2614 user IDs for \fBls\fR \fB-l\fR and \fBls\fR \fB-o\fR
2618 .ne 2
2620 \fB\fB/usr/share/lib/terminfo/?/*\fR\fR
2622 .sp .6
2623 .RS 4n
2624 terminal information database
2627 .SH ATTRIBUTES
2629 See \fBattributes\fR(5) for descriptions of the following attributes:
2630 .SS "/usr/bin/ls"
2633 box;
2634 c | c
2635 l | l .
2636 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2638 CSI     Enabled
2640 Interface Stability     Committed
2642 Standard        See below.
2647 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2648 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2649 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2650 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2651 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2652 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2653 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2654 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2655 .SH SEE ALSO
2657 \fBchmod\fR(1), \fBcp\fR(1), \fBsetfacl\fR(1), \fBfgetattr\fR(3C),
2658 \fBstrftime\fR(3C), \fBterminfo\fR(4), \fBacl\fR(5), \fBattributes\fR(5),
2659 \fBenviron\fR(5), \fBfsattr\fR(5), \fBstandards\fR(5)
2660 .SH NOTES
2662 Unprintable characters in file names can confuse the columnar output options.
2665 The total block count is incorrect if there are hard links among the files.
2668 The sort order of \fBls\fR output is affected by the locale and can be
2669 overridden by the \fBLC_COLLATE\fR environment variable. For example, if
2670 \fBLC_COLLATE\fR equals \fBC\fR, dot files appear first, followed by names
2671 beginning with upper-case letters, then followed by names beginning with
2672 lower-case letters. But if \fBLC_COLLATE\fR equals \fBen_US.ISO8859-1\fR, then
2673 leading dots as well as case are ignored in determining the sort order.