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