]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - bin/ls/ls.1
ls: fix a --color regression from r337956
[FreeBSD/FreeBSD.git] / bin / ls / ls.1
1 .\"-
2 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
3 .\"     The Regents of the University of California.  All rights reserved.
4 .\"
5 .\" This code is derived from software contributed to Berkeley by
6 .\" the Institute of Electrical and Electronics Engineers, Inc.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)ls.1        8.7 (Berkeley) 7/29/94
33 .\" $FreeBSD$
34 .\"
35 .Dd May 20, 2020
36 .Dt LS 1
37 .Os
38 .Sh NAME
39 .Nm ls
40 .Nd list directory contents
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,
44 .Op Fl -color Ns = Ns Ar when
45 .Op Fl D Ar format
46 .Op Ar
47 .Sh DESCRIPTION
48 For each operand that names a
49 .Ar file
50 of a type other than
51 directory,
52 .Nm
53 displays its name as well as any requested,
54 associated information.
55 For each operand that names a
56 .Ar file
57 of type directory,
58 .Nm
59 displays the names of files contained
60 within that directory, as well as any requested, associated
61 information.
62 .Pp
63 If no operands are given, the contents of the current
64 directory are displayed.
65 If more than one operand is given,
66 non-directory operands are displayed first; directory
67 and non-directory operands are sorted separately and in
68 lexicographical order.
69 .Pp
70 The following options are available:
71 .Bl -tag -width indent
72 .It Fl A
73 Include directory entries whose names begin with a
74 dot
75 .Pq Sq Pa \&.
76 except for
77 .Pa \&.
78 and
79 .Pa .. .
80 Automatically set for the super-user unless
81 .Fl I
82 is specified.
83 .It Fl B
84 Force printing of non-printable characters (as defined by
85 .Xr ctype 3
86 and current locale settings) in file names as
87 .Li \e Ns Va xxx ,
88 where
89 .Va xxx
90 is the numeric value of the character in octal.
91 This option is not defined in
92 .St -p1003.1-2001 .
93 .It Fl C
94 Force multi-column output; this is the default when output is to a terminal.
95 .It Fl D Ar format
96 When printing in the long
97 .Pq Fl l
98 format, use
99 .Ar format
100 to format the date and time output.
101 The argument
102 .Ar format
103 is a string used by
104 .Xr strftime 3 .
105 Depending on the choice of format string, this may result in a
106 different number of columns in the output.
107 This option overrides the
108 .Fl T
109 option.
110 This option is not defined in
111 .St -p1003.1-2001 .
112 .It Fl F
113 Display a slash
114 .Pq Ql /
115 immediately after each pathname that is a directory,
116 an asterisk
117 .Pq Ql *
118 after each that is executable,
119 an at sign
120 .Pq Ql @
121 after each symbolic link,
122 an equals sign
123 .Pq Ql =
124 after each socket,
125 a percent sign
126 .Pq Ql %
127 after each whiteout,
128 and a vertical bar
129 .Pq Ql \&|
130 after each that is a
131 .Tn FIFO .
132 .It Fl G
133 Enable colorized output.
134 This option is equivalent to defining
135 .Ev CLICOLOR
136 or
137 .Ev COLORTERM
138 in the environment.
139 (See below.)
140 This functionality can be compiled out by removing the definition of
141 .Ev COLORLS .
142 This option is not defined in
143 .St -p1003.1-2001 .
144 .It Fl H
145 Symbolic links on the command line are followed.
146 This option is assumed if
147 none of the
148 .Fl F , d ,
149 or
150 .Fl l
151 options are specified.
152 .It Fl I
153 Prevent
154 .Fl A
155 from being automatically set for the super-user.
156 This option is not defined in
157 .St -p1003.1-2001 .
158 .It Fl L
159 If argument is a symbolic link, list the file or directory the link references
160 rather than the link itself.
161 This option cancels the
162 .Fl P
163 option.
164 .It Fl P
165 If argument is a symbolic link, list the link itself rather than the
166 object the link references.
167 This option cancels the
168 .Fl H
169 and
170 .Fl L
171 options.
172 .It Fl R
173 Recursively list subdirectories encountered.
174 .It Fl S
175 Sort by size (largest file first) before sorting the operands in
176 lexicographical order.
177 .It Fl T
178 When printing in the long
179 .Pq Fl l
180 format, display complete time information for the file, including
181 month, day, hour, minute, second, and year.
182 The
183 .Fl D
184 option gives even more control over the output format.
185 This option is not defined in
186 .St -p1003.1-2001 .
187 .It Fl U
188 Use time when file was created for sorting or printing.
189 This option is not defined in
190 .St -p1003.1-2001 .
191 .It Fl W
192 Display whiteouts when scanning directories.
193 This option is not defined in
194 .St -p1003.1-2001 .
195 .It Fl Z
196 Display each file's MAC label; see
197 .Xr maclabel 7 .
198 This option is not defined in
199 .St -p1003.1-2001 .
200 .It Fl a
201 Include directory entries whose names begin with a
202 dot
203 .Pq Sq Pa \&. .
204 .It Fl b
205 As
206 .Fl B ,
207 but use
208 .Tn C
209 escape codes whenever possible.
210 This option is not defined in
211 .St -p1003.1-2001 .
212 .It Fl c
213 Use time when file status was last changed for sorting or printing.
214 .It Fl -color Ns = Ns Ar when
215 Output colored escape sequences based on
216 .Ar when ,
217 which may be set to either
218 .Cm always ,
219 .Cm auto ,
220 or
221 .Cm never .
222 .Pp
223 .Cm always
224 will make
225 .Nm
226 always output color.
227 If
228 .Ev TERM
229 is unset or set to an invalid terminal, then
230 .Nm
231 will fall back to explicit
232 .Tn ANSI
233 escape sequences without the help of
234 .Xr termcap 5 .
235 .Cm always
236 is the default if
237 .Fl -color
238 is specified without an argument.
239 .Pp
240 .Cm auto
241 will make
242 .Nm
243 output escape sequences based on
244 .Xr termcap 5 ,
245 but only if
246 .Dv stdout
247 is a tty and either the
248 .Fl G
249 flag is specified or the
250 .Ev COLORTERM
251 environment variable is set and not empty.
252 .Pp
253 .Cm never
254 will disable color regardless of environment variables.
255 .Cm never
256 is the default when neither
257 .Fl -color
258 nor
259 .Fl G
260 is specified.
261 .Pp
262 For compatibility with GNU coreutils,
263 .Nm
264 supports
265 .Cm yes
266 or
267 .Cm force
268 as equivalent to
269 .Cm always ,
270 .Cm no
271 or
272 .Cm none
273 as equivalent to
274 .Cm never ,
275 and
276 .Cm tty
277 or
278 .Cm if-tty
279 as equivalent to
280 .Cm auto .
281 .It Fl d
282 Directories are listed as plain files (not searched recursively).
283 .It Fl f
284 Output is not sorted.
285 This option turns on
286 .Fl a .
287 It also negates the effect of the
288 .Fl r ,
289 .Fl S
290 and
291 .Fl t
292 options.
293 As allowed by
294 .St -p1003.1-2001 ,
295 this option has no effect on the
296 .Fl d ,
297 .Fl l ,
298 .Fl R
299 and
300 .Fl s
301 options.
302 .It Fl g
303 This option has no effect.
304 It is only available for compatibility with
305 .Bx 4.3 ,
306 where it was used to display the group name in the long
307 .Pq Fl l
308 format output.
309 This option is incompatible with
310 .St -p1003.1-2001 .
311 .It Fl h
312 When used with the
313 .Fl l
314 option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte
315 and Petabyte in order to reduce the number of digits to four or fewer
316 using base 2 for sizes.
317 This option is not defined in
318 .St -p1003.1-2001 .
319 .It Fl i
320 For each file, print the file's file serial number (inode number).
321 .It Fl k
322 This has the same effect as setting environment variable
323 .Ev BLOCKSIZE
324 to 1024, except that it also nullifies any
325 .Fl h
326 options to its left.
327 .It Fl l
328 (The lowercase letter
329 .Dq ell . )
330 List files in the long format, as described in the
331 .Sx The Long Format
332 subsection below.
333 .It Fl m
334 Stream output format; list files across the page, separated by commas.
335 .It Fl n
336 Display user and group IDs numerically rather than converting to a user
337 or group name in a long
338 .Pq Fl l
339 output.
340 .It Fl o
341 Include the file flags in a long
342 .Pq Fl l
343 output.
344 This option is incompatible with
345 .St -p1003.1-2001 .
346 See
347 .Xr chflags 1
348 for a list of file flags and their meanings.
349 .It Fl p
350 Write a slash
351 .Pq Ql /
352 after each filename if that file is a directory.
353 .It Fl q
354 Force printing of non-graphic characters in file names as
355 the character
356 .Ql \&? ;
357 this is the default when output is to a terminal.
358 .It Fl r
359 Reverse the order of the sort.
360 .It Fl s
361 Display the number of blocks used in the file system by each file.
362 Block sizes and directory totals are handled as described in
363 .Sx The Long Format
364 subsection below, except (if the long format is not also requested)
365 the directory totals are not output when the output is in a
366 single column, even if multi-column output is requested.
367 .It Fl t
368 Sort by descending time modified (most recently modified first).
369 If two files have the same modification timestamp, sort their names
370 in ascending lexicographical order.
371 The
372 .Fl r
373 option reverses both of these sort orders.
374 .Pp
375 Note that these sort orders are contradictory: the time sequence is in
376 descending order, the lexicographical sort is in ascending order.
377 This behavior is mandated by
378 .St -p1003.2 .
379 This feature can cause problems listing files stored with sequential names on
380 FAT file systems, such as from digital cameras, where it is possible to have
381 more than one image with the same timestamp.
382 In such a case, the photos cannot be listed in the sequence in which
383 they were taken.
384 To ensure the same sort order for time and for lexicographical sorting, set the
385 environment variable
386 .Ev LS_SAMESORT
387 or use the
388 .Fl y
389 option.
390 This causes
391 .Nm
392 to reverse the lexicographical sort order when sorting files with the
393 same modification timestamp.
394 .It Fl u
395 Use time of last access,
396 instead of time of last modification
397 of the file for sorting
398 .Pq Fl t
399 or printing
400 .Pq Fl l .
401 .It Fl w
402 Force raw printing of non-printable characters.
403 This is the default
404 when output is not to a terminal.
405 This option is not defined in
406 .St -p1003.1-2001 .
407 .It Fl x
408 The same as
409 .Fl C ,
410 except that the multi-column output is produced with entries sorted
411 across, rather than down, the columns.
412 .It Fl y
413 When the
414 .Fl t
415 option is set, sort the alphabetical output in the same order as the time output.
416 This has the same effect as setting
417 .Ev LS_SAMESORT .
418 See the description of the
419 .Fl t
420 option for more details.
421 This option is not defined in
422 .St -p1003.1-2001 .
423 .It Fl 1
424 (The numeric digit
425 .Dq one . )
426 Force output to be
427 one entry per line.
428 This is the default when
429 output is not to a terminal.
430 .It Fl ,
431 (Comma) When the
432 .Fl l
433 option is set, print file sizes grouped and separated by thousands using the
434 non-monetary separator returned by
435 .Xr localeconv 3 ,
436 typically a comma or period.
437 If no locale is set, or the locale does not have a non-monetary separator, this
438 option has no effect.
439 This option is not defined in
440 .St -p1003.1-2001 .
441 .El
442 .Pp
443 The
444 .Fl 1 , C , x ,
445 and
446 .Fl l
447 options all override each other; the last one specified determines
448 the format used.
449 .Pp
450 The
451 .Fl c , u ,
452 and
453 .Fl U
454 options all override each other; the last one specified determines
455 the file time used.
456 .Pp
457 The
458 .Fl S
459 and
460 .Fl t
461 options override each other; the last one specified determines
462 the sort order used.
463 .Pp
464 The
465 .Fl B , b , w ,
466 and
467 .Fl q
468 options all override each other; the last one specified determines
469 the format used for non-printable characters.
470 .Pp
471 The
472 .Fl H , L
473 and
474 .Fl P
475 options all override each other (either partially or fully); they
476 are applied in the order specified.
477 .Pp
478 By default,
479 .Nm
480 lists one entry per line to standard
481 output; the exceptions are to terminals or when the
482 .Fl C
483 or
484 .Fl x
485 options are specified.
486 .Pp
487 File information is displayed with one or more
488 .Ao blank Ac Ns s
489 separating the information associated with the
490 .Fl i , s ,
491 and
492 .Fl l
493 options.
494 .Ss The Long Format
495 If the
496 .Fl l
497 option is given, the following information
498 is displayed for each file:
499 file mode,
500 number of links, owner name, group name,
501 MAC label,
502 number of bytes in the file, abbreviated
503 month, day-of-month file was last modified,
504 hour file last modified, minute file last
505 modified, and the pathname.
506 .Pp
507 If the modification time of the file is more than 6 months
508 in the past or future, and the
509 .Fl D
510 or
511 .Fl T
512 are not specified,
513 then the year of the last modification
514 is displayed in place of the hour and minute fields.
515 .Pp
516 If the owner or group names are not a known user or group name,
517 or the
518 .Fl n
519 option is given,
520 the numeric ID's are displayed.
521 .Pp
522 If the file is a character special or block special file,
523 the device number for the file is displayed in the size field.
524 If the file is a symbolic link the pathname of the
525 linked-to file is preceded by
526 .Dq Li -> .
527 .Pp
528 The listing of a directory's contents is preceded
529 by a labeled total number of blocks used in the file system by the files
530 which are listed as the directory's contents
531 (which may or may not include
532 .Pa \&.
533 and
534 .Pa ..
535 and other files which start with a dot, depending on other options).
536 .Pp
537 The default block size is 512 bytes.
538 The block size may be set with option
539 .Fl k
540 or environment variable
541 .Ev BLOCKSIZE .
542 Numbers of blocks in the output will have been rounded up so the
543 numbers of bytes is at least as many as used by the corresponding
544 file system blocks (which might have a different size).
545 .Pp
546 The file mode printed under the
547 .Fl l
548 option consists of the
549 entry type and the permissions.
550 The entry type character describes the type of file, as
551 follows:
552 .Pp
553 .Bl -tag -width 4n -offset indent -compact
554 .It Sy \-
555 Regular file.
556 .It Sy b
557 Block special file.
558 .It Sy c
559 Character special file.
560 .It Sy d
561 Directory.
562 .It Sy l
563 Symbolic link.
564 .It Sy p
565 .Tn FIFO .
566 .It Sy s
567 Socket.
568 .It Sy w
569 Whiteout.
570 .El
571 .Pp
572 The next three fields
573 are three characters each:
574 owner permissions,
575 group permissions, and
576 other permissions.
577 Each field has three character positions:
578 .Bl -enum -offset indent
579 .It
580 If
581 .Sy r ,
582 the file is readable; if
583 .Sy \- ,
584 it is not readable.
585 .It
586 If
587 .Sy w ,
588 the file is writable; if
589 .Sy \- ,
590 it is not writable.
591 .It
592 The first of the following that applies:
593 .Bl -tag -width 4n -offset indent
594 .It Sy S
595 If in the owner permissions, the file is not executable and
596 set-user-ID mode is set.
597 If in the group permissions, the file is not executable
598 and set-group-ID mode is set.
599 .It Sy s
600 If in the owner permissions, the file is executable
601 and set-user-ID mode is set.
602 If in the group permissions, the file is executable
603 and setgroup-ID mode is set.
604 .It Sy x
605 The file is executable or the directory is
606 searchable.
607 .It Sy \-
608 The file is neither readable, writable, executable,
609 nor set-user-ID nor set-group-ID mode, nor sticky.
610 (See below.)
611 .El
612 .Pp
613 These next two apply only to the third character in the last group
614 (other permissions).
615 .Bl -tag -width 4n -offset indent
616 .It Sy T
617 The sticky bit is set
618 (mode
619 .Li 1000 ) ,
620 but not execute or search permission.
621 (See
622 .Xr chmod 1
623 or
624 .Xr sticky 7 . )
625 .It Sy t
626 The sticky bit is set (mode
627 .Li 1000 ) ,
628 and is searchable or executable.
629 (See
630 .Xr chmod 1
631 or
632 .Xr sticky 7 . )
633 .El
634 .El
635 .Pp
636 The next field contains a
637 plus
638 .Pq Ql +
639 character if the file has an ACL, or a
640 space
641 .Pq Ql " "
642 if it does not.
643 The
644 .Nm
645 utility does not show the actual ACL;
646 use
647 .Xr getfacl 1
648 to do this.
649 .Sh ENVIRONMENT
650 The following environment variables affect the execution of
651 .Nm :
652 .Bl -tag -width ".Ev CLICOLOR_FORCE"
653 .It Ev BLOCKSIZE
654 If this is set, its value, rounded up to 512 or down to a
655 multiple of 512, will be used as the block size in bytes by the
656 .Fl l
657 and
658 .Fl s
659 options.
660 See
661 .Sx The Long Format
662 subsection for more information.
663 .It Ev CLICOLOR
664 Use
665 .Tn ANSI
666 color sequences to distinguish file types.
667 See
668 .Ev LSCOLORS
669 below.
670 In addition to the file types mentioned in the
671 .Fl F
672 option some extra attributes (setuid bit set, etc.) are also displayed.
673 The colorization is dependent on a terminal type with the proper
674 .Xr termcap 5
675 capabilities.
676 The default
677 .Dq Li cons25
678 console has the proper capabilities,
679 but to display the colors in an
680 .Xr xterm 1 ,
681 for example,
682 the
683 .Ev TERM
684 variable must be set to
685 .Dq Li xterm-color .
686 Other terminal types may require similar adjustments.
687 Colorization
688 is silently disabled if the output is not directed to a terminal
689 unless the
690 .Ev CLICOLOR_FORCE
691 variable is defined or
692 .Fl -color
693 is set to
694 .Dq always .
695 .It Ev CLICOLOR_FORCE
696 Color sequences are normally disabled if the output is not directed to
697 a terminal.
698 This can be overridden by setting this variable.
699 The
700 .Ev TERM
701 variable still needs to reference a color capable terminal however
702 otherwise it is not possible to determine which color sequences to
703 use.
704 .It Ev COLORTERM
705 See description for
706 .Ev CLICOLOR
707 above.
708 .It Ev COLUMNS
709 If this variable contains a string representing a
710 decimal integer, it is used as the
711 column position width for displaying
712 multiple-text-column output.
713 The
714 .Nm
715 utility calculates how
716 many pathname text columns to display
717 based on the width provided.
718 (See
719 .Fl C
720 and
721 .Fl x . )
722 .It Ev LANG
723 The locale to use when determining the order of day and month in the long
724 .Fl l
725 format output.
726 See
727 .Xr environ 7
728 for more information.
729 .It Ev LSCOLORS
730 The value of this variable describes what color to use for which
731 attribute when colors are enabled with
732 .Ev CLICOLOR
733 or
734 .Ev COLORTERM .
735 This string is a concatenation of pairs of the format
736 .Ar f Ns Ar b ,
737 where
738 .Ar f
739 is the foreground color and
740 .Ar b
741 is the background color.
742 .Pp
743 The color designators are as follows:
744 .Pp
745 .Bl -tag -width 4n -offset indent -compact
746 .It Sy a
747 black
748 .It Sy b
749 red
750 .It Sy c
751 green
752 .It Sy d
753 brown
754 .It Sy e
755 blue
756 .It Sy f
757 magenta
758 .It Sy g
759 cyan
760 .It Sy h
761 light grey
762 .It Sy A
763 bold black, usually shows up as dark grey
764 .It Sy B
765 bold red
766 .It Sy C
767 bold green
768 .It Sy D
769 bold brown, usually shows up as yellow
770 .It Sy E
771 bold blue
772 .It Sy F
773 bold magenta
774 .It Sy G
775 bold cyan
776 .It Sy H
777 bold light grey; looks like bright white
778 .It Sy x
779 default foreground or background
780 .El
781 .Pp
782 Note that the above are standard
783 .Tn ANSI
784 colors.
785 The actual display may differ
786 depending on the color capabilities of the terminal in use.
787 .Pp
788 The order of the attributes are as follows:
789 .Pp
790 .Bl -enum -offset indent -compact
791 .It
792 directory
793 .It
794 symbolic link
795 .It
796 socket
797 .It
798 pipe
799 .It
800 executable
801 .It
802 block special
803 .It
804 character special
805 .It
806 executable with setuid bit set
807 .It
808 executable with setgid bit set
809 .It
810 directory writable to others, with sticky bit
811 .It
812 directory writable to others, without sticky bit
813 .El
814 .Pp
815 The default is
816 .Qq "exfxcxdxbxegedabagacad" ,
817 i.e., blue foreground and
818 default background for regular directories, black foreground and red
819 background for setuid executables, etc.
820 .It Ev LS_COLWIDTHS
821 If this variable is set, it is considered to be a
822 colon-delimited list of minimum column widths.
823 Unreasonable
824 and insufficient widths are ignored (thus zero signifies
825 a dynamically sized column).
826 Not all columns have changeable widths.
827 The fields are,
828 in order: inode, block count, number of links, user name,
829 group name, flags, file size, file name.
830 .It Ev LS_SAMESORT
831 If this variable is set, the
832 .Fl t
833 option sorts the names of files with the same modification timestamp in the same
834 sense as the time sort.
835 See the description of the
836 .Fl t
837 option for more details.
838 .It Ev TERM
839 The
840 .Ev CLICOLOR
841 and
842 .Ev COLORTERM
843 functionality depends on a terminal type with color capabilities.
844 .It Ev TZ
845 The timezone to use when displaying dates.
846 See
847 .Xr environ 7
848 for more information.
849 .El
850 .Sh EXIT STATUS
851 .Ex -std
852 .Sh EXAMPLES
853 List the contents of the current working directory in long format:
854 .Pp
855 .Dl $ ls -l
856 .Pp
857 In addition to listing the contents of the current working directory in
858 long format, show inode numbers, file flags (see
859 .Xr chflags 1 ) ,
860 and suffix each filename with a symbol representing its file type:
861 .Pp
862 .Dl $ ls -lioF
863 .Pp
864 List the files in
865 .Pa /var/log ,
866 sorting the output such that the mostly recently modified entries are
867 printed first:
868 .Pp
869 .Dl $ ls -lt /var/log
870 .Sh COMPATIBILITY
871 The group field is now automatically included in the long listing for
872 files in order to be compatible with the
873 .St -p1003.2
874 specification.
875 .Sh SEE ALSO
876 .Xr chflags 1 ,
877 .Xr chmod 1 ,
878 .Xr getfacl 1 ,
879 .Xr sort 1 ,
880 .Xr xterm 1 ,
881 .Xr localeconv 3 ,
882 .Xr strftime 3 ,
883 .Xr strmode 3 ,
884 .Xr termcap 5 ,
885 .Xr maclabel 7 ,
886 .Xr sticky 7 ,
887 .Xr symlink 7 ,
888 .Xr getfmac 8
889 .Sh STANDARDS
890 With the exception of options
891 .Fl g , n
892 and
893 .Fl o ,
894 the
895 .Nm
896 utility conforms to
897 .St -p1003.1-2001 .
898 The options
899 .Fl B , D , G , I , T , U , W , Z , b , h , w , y
900 and
901 .Fl ,
902 are compatible extensions not defined in
903 .St -p1003.1-2001 .
904 .Pp
905 The ACL support is compatible with
906 .Tn IEEE
907 Std\~1003.2c
908 .Pq Dq Tn POSIX Ns .2c
909 Draft\~17
910 (withdrawn).
911 .Sh HISTORY
912 An
913 .Nm
914 command appeared in
915 .At v1 .
916 .Sh BUGS
917 To maintain backward compatibility, the relationships between the many
918 options are quite complex.
919 .Pp
920 The exception mentioned in the
921 .Fl s
922 option description might be a feature that was
923 based on the fact that single-column output
924 usually goes to something other than a terminal.
925 It is debatable whether this is a design bug.
926 .Pp
927 .St -p1003.2
928 mandates opposite sort orders for files with the same timestamp when
929 sorting with the
930 .Fl t
931 option.