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