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 "Nov 24, 2014"
  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
  59 
  60 .LP
  61 .nf
  62 \fB/usr/xpg4/bin/ls\fR [\fB-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@\fR]
  63      [\fB-/ c\fR | \fBv\fR] [\fB-% atime | crtime | ctime | mtime | all\fR]
  64      [--block-size size] [--color[=\fIwhen\fR]] [--file-type]
  65      [--si] [--time-style \fIstyle\fR] [\fIfile\fR]...
  66 .fi
  67 
  68 .LP
  69 .nf
  70 \fB/usr/xpg6/bin/ls\fR [\fB-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@\fR]
  71      [\fB-/ c\fR | \fBv\fR] [\fB-% atime | crtime | ctime | mtime | all\fR]
  72      [--block-size size] [--color[=\fIwhen\fR]] [--file-type]
  73      [--si] [--time-style \fIstyle\fR] [\fIfile\fR]...
  74 .fi
  75 
  76 .SH DESCRIPTION
  77 .LP
  78 For each \fIfile\fR that is a directory, \fBls\fR lists the contents of the
  79 directory. For each \fIfile\fR that is an ordinary file, \fBls\fR repeats its
  80 name and any other information requested. The output is sorted alphabetically
  81 by default. When no argument is given, the current directory (\fB\&.\fR) is
  82 listed. When several arguments are given, the arguments are first sorted
  83 appropriately, but file arguments appear before directories and their contents.
  84 .sp
  85 .LP
  86 There are three major listing formats. The default format for output directed
  87 to a terminal is multi\(micolumn with entries sorted down the columns. The
  88 \fB-1\fR option allows single column output and \fB-m\fR enables stream output
  89 format. In order to determine output formats for the \fB-C\fR, \fB-x\fR, and
  90 \fB-m\fR options, \fBls\fR uses an environment variable, \fBCOLUMNS\fR, to
  91 determine the number of character positions available on one output line. If
  92 this variable is not set, the \fBterminfo\fR(4) database is used to determine
  93 the number of columns, based on the environment variable, \fBTERM\fR. If this
  94 information cannot be obtained, 80 columns are assumed. If the \fB-w\fR option
  95 is used, the argument overrides any other column width.
  96 .sp
  97 .LP
  98 The mode printed when the \fB-e\fR, \fB-E\fR, \fB-g\fR, \fB-l\fR, \fB-n\fR,
  99 \fB-o\fR, \fB-v\fR, \fB-V\fR, or \fB-@\fR option is in effect consists of
 100 eleven characters. The first character can be one of the following:
 101 .sp
 102 .ne 2
 103 .na
 104 \fB\fBd\fR\fR
 105 .ad
 106 .sp .6
 107 .RS 4n
 108 The entry is a directory.
 109 .RE
 110 
 111 .sp
 112 .ne 2
 113 .na
 114 \fB\fBD\fR\fR
 115 .ad
 116 .sp .6
 117 .RS 4n
 118 The entry is a door.
 119 .RE
 120 
 121 .sp
 122 .ne 2
 123 .na
 124 \fB\fBl\fR\fR
 125 .ad
 126 .sp .6
 127 .RS 4n
 128 The entry is a symbolic link.
 129 .RE
 130 
 131 .sp
 132 .ne 2
 133 .na
 134 \fB\fBb\fR\fR
 135 .ad
 136 .sp .6
 137 .RS 4n
 138 The entry is a block special file.
 139 .RE
 140 
 141 .sp
 142 .ne 2
 143 .na
 144 \fB\fBc\fR\fR
 145 .ad
 146 .sp .6
 147 .RS 4n
 148 The entry is a character special file.
 149 .RE
 150 
 151 .sp
 152 .ne 2
 153 .na
 154 \fB\fBp\fR\fR
 155 .ad
 156 .sp .6
 157 .RS 4n
 158 The entry is a \fBFIFO\fR (or "named pipe") special file.
 159 .RE
 160 
 161 .sp
 162 .ne 2
 163 .na
 164 \fB\fBP\fR\fR
 165 .ad
 166 .sp .6
 167 .RS 4n
 168 The entry is an event port.
 169 .RE
 170 
 171 .sp
 172 .ne 2
 173 .na
 174 \fB\fBs\fR\fR
 175 .ad
 176 .sp .6
 177 .RS 4n
 178 The entry is an \fBAF_UNIX\fR address family socket.
 179 .RE
 180 
 181 .sp
 182 .ne 2
 183 .na
 184 \fB\fB\(mi\fR\fR
 185 .ad
 186 .sp .6
 187 .RS 4n
 188 The entry is an ordinary file.
 189 .RE
 190 
 191 .sp
 192 .LP
 193 The next 9 characters are interpreted as three sets of three bits each. The
 194 first set refers to the owner's permissions; the next to permissions of others
 195 in the user-group of the file; and the last to all others. Within each set, the
 196 three characters indicate permission to read, to write, and to execute the file
 197 as a program, respectively. For a directory, \fBexecute\fR permission is
 198 interpreted to mean permission to search the directory for a specified file.
 199 The character after permissions is an ACL or extended attributes indicator.
 200 This character is an \fB@\fR if extended attributes are associated with the
 201 file and the \fB-@\fR option is in effect. Otherwise, this character is a plus
 202 sign (\fB+\fR) character if a non-trivial ACL is associated with the file or a
 203 space character if not.
 204 .sp
 205 .LP
 206 If \fB-/\fR and/or \fB-%\fR are in effect, then the extended system attributes
 207 are printed when filesystem supports extended system attributes. The display
 208 looks as follows:
 209 .sp
 210 .in +2
 211 .nf
 212 $ls -/ c  file
 213 -rw-r--r--   1 root     root           0 May 10 14:17 file
 214                 {AHRSadim-u--}
 215 
 216 $ls -/ v file
 217 -rw-r--r--   1 root     root           0 May 10 14:17 file
 218                 {archive,hidden,readonly,system,\e
 219                  appendonly,nodump,immutable,av_modified,\e
 220                  noav_quarantined,nounlink,nooffline,\e
 221                  nosparse}
 222 
 223 $ls -l -% all file
 224 -rw-r--r--   1 root     root           0 May 10 14:17 file
 225                 timestamp: atime    Jun 25 12:56:44 2007
 226                 timestamp: ctime    May 10 14:20:23 2007
 227                 timestamp: mtime    May 10 14:17:56 2007
 228                 timestamp: crtime   May 10 14:17:56 2007
 229 .fi
 230 .in -2
 231 .sp
 232 
 233 .sp
 234 .LP
 235 See the option descriptions of the \fB-/\fR and \fB-%\fR option for details.
 236 .sp
 237 .LP
 238 \fBls\fR \fB-l\fR (the long list) prints its output as follows for the POSIX
 239 locale:
 240 .sp
 241 .in +2
 242 .nf
 243 -rwxrwxrwx+ 1 smith dev   10876  May 16 9:42 part2
 244 .fi
 245 .in -2
 246 .sp
 247 
 248 .sp
 249 .LP
 250 Reading from right to left, you see that the current directory holds one file,
 251 named \fBpart2\fR. Next, the last time that file's contents were modified was
 252 \fB9:42 A.M.\fR on \fBMay 16\fR. The file contains 10,876 characters, or bytes.
 253 The owner of the file, or the user, belongs to the group \fBdev\fR (perhaps
 254 indicating \fBdevelopment\fR), and his or her login name is \fBsmith\fR. The
 255 number, in this case \fB1\fR, indicates the number of links to file \fBpart2\fR
 256 (see \fBcp\fR(1)). The plus sign indicates that there is an \fBACL\fR
 257 associated with the file. If the \fB-@\fR option has been specified, the
 258 presence of extended attributes supersede the presence of an \fBACL\fR and the
 259 plus sign is replaced with an 'at' sign (\fB@\fR). Finally, the dash and
 260 letters tell you that user, group, and others have permissions to read, write,
 261 and execute \fBpart2\fR.
 262 .sp
 263 .LP
 264 The execute (\fBx\fR) symbol occupies the third position of the three-character
 265 sequence. A \fB\(mi\fR in the third position would have indicated a denial of
 266 execution permissions.
 267 .sp
 268 .LP
 269 The permissions are indicated as follows:
 270 .sp
 271 .ne 2
 272 .na
 273 \fB\fBr\fR\fR
 274 .ad
 275 .sp .6
 276 .RS 4n
 277 The file is readable.
 278 .RE
 279 
 280 .sp
 281 .ne 2
 282 .na
 283 \fB\fBw\fR\fR
 284 .ad
 285 .sp .6
 286 .RS 4n
 287 The file is writable.
 288 .RE
 289 
 290 .sp
 291 .ne 2
 292 .na
 293 \fB\fBx\fR\fR
 294 .ad
 295 .sp .6
 296 .RS 4n
 297 The file is executable.
 298 .RE
 299 
 300 .sp
 301 .ne 2
 302 .na
 303 \fB\fB\(mi\fR\fR
 304 .ad
 305 .sp .6
 306 .RS 4n
 307 The indicated permission is \fInot\fR granted.
 308 .RE
 309 
 310 .sp
 311 .ne 2
 312 .na
 313 \fB\fBs\fR\fR
 314 .ad
 315 .sp .6
 316 .RS 4n
 317 The \fBs\fRet-user-ID or \fBs\fRet-group-ID bit is on, and the corresponding
 318 user or group execution bit is also on.
 319 .RE
 320 
 321 .sp
 322 .ne 2
 323 .na
 324 \fB\fBS\fR\fR
 325 .ad
 326 .sp .6
 327 .RS 4n
 328 Undefined bit-state (the set-user-ID or set-group-id bit is on and the user or
 329 group execution bit is off). For group permissions, this applies only to
 330 non-regular files.
 331 .RE
 332 
 333 .sp
 334 .ne 2
 335 .na
 336 \fB\fBt\fR\fR
 337 .ad
 338 .sp .6
 339 .RS 4n
 340 The 1000 (octal) bit, or sticky bit, is on (see \fBchmod\fR(1)), and execution
 341 is on.
 342 .RE
 343 
 344 .sp
 345 .ne 2
 346 .na
 347 \fB\fBT\fR\fR
 348 .ad
 349 .sp .6
 350 .RS 4n
 351 The 1000 bit is turned on, and execution is off (undefined bit-state).
 352 .RE
 353 
 354 .SS "/usr/bin/ls"
 355 .ne 2
 356 .na
 357 \fB\fBl\fR\fR
 358 .ad
 359 .sp .6
 360 .RS 4n
 361 Mandatory locking occurs during access (on a regular file, the set-group-ID bit
 362 is on and the group execution bit is off).
 363 .RE
 364 
 365 .SS "/usr/xpg4/bin/ls and /usr/xpg6/bin/ls"
 366 .ne 2
 367 .na
 368 \fB\fBL\fR\fR
 369 .ad
 370 .sp .6
 371 .RS 4n
 372 Mandatory locking occurs during access (on a regular file, the set-group-ID bit
 373 is on and the group execution bit is off).
 374 .RE
 375 
 376 .sp
 377 .LP
 378 For user and group permissions, the third position is sometimes occupied by a
 379 character other than \fBx\fR or \fB-\fR. \fBs\fR or \fBS\fR also can occupy
 380 this position, referring to the state of the set-ID bit, whether it be the
 381 user's or the group's. The ability to assume the same ID as the user during
 382 execution is, for example, used during login when you begin as root but need to
 383 assume the identity of the user you login as.
 384 .sp
 385 .LP
 386 In the case of the sequence of group permissions, \fBl\fR can occupy the third
 387 position. \fBl\fR refers to mandatory file and record locking. This permission
 388 describes a file's ability to allow other files to lock its reading or writing
 389 permissions during access.
 390 .sp
 391 .LP
 392 For others permissions, the third position can be occupied by \fBt\fR or
 393 \fBT\fR. These refer to the state of the sticky bit and execution permissions.
 394 .SS "Color Output"
 395 .LP
 396 If color output is enabled, the environment variable LS_COLORS is checked.  If
 397 it exists, it's contents are used to control the colors used to display
 398 filenames.  If it is not set, a default list of colors is used. The format of
 399 LS_COLORS is a colon separated list of attribute specifications. Each attribute
 400 specification is of the format
 401 .sp
 402 .in +2
 403 .nf
 404 \fIfilespec\fR=\fIattr\fR[;\fIattr\fR..]
 405 .fi
 406 .in -2
 407 .sp
 408 
 409 .sp
 410 .LP
 411 \fIfilespec\fR is either of the form \fI*.SUFFIX\fR, for example, \fB*.jar\fR
 412 or \fB*.Z\fR, or one of the following file types:
 413 .sp
 414 .ne 2
 415 .na
 416 \fB\fBno\fR\fR
 417 .ad
 418 .sp .6
 419 .RS 4n
 420 Normal file
 421 .RE
 422 
 423 .sp
 424 .ne 2
 425 .na
 426 \fB\fBfi\fR\fR
 427 .ad
 428 .sp .6
 429 .RS 4n
 430 Regular file
 431 .RE
 432 
 433 .sp
 434 .ne 2
 435 .na
 436 \fB\fBdi\fR\fR
 437 .ad
 438 .sp .6
 439 .RS 4n
 440 Directory
 441 .RE
 442 
 443 .sp
 444 .ne 2
 445 .na
 446 \fB\fBln\fR\fR
 447 .ad
 448 .sp .6
 449 .RS 4n
 450 Symbolic link
 451 .RE
 452 
 453 .sp
 454 .ne 2
 455 .na
 456 \fB\fBpi\fR\fR
 457 .ad
 458 .sp .6
 459 .RS 4n
 460 FIFO or named pipe
 461 .RE
 462 
 463 .sp
 464 .ne 2
 465 .na
 466 \fB\fBso\fR\fR
 467 .ad
 468 .sp .6
 469 .RS 4n
 470 Socket
 471 .RE
 472 
 473 .sp
 474 .ne 2
 475 .na
 476 \fB\fBdo\fR\fR
 477 .ad
 478 .sp .6
 479 .RS 4n
 480 Door file
 481 .RE
 482 
 483 .sp
 484 .ne 2
 485 .na
 486 \fB\fBbd\fR\fR
 487 .ad
 488 .sp .6
 489 .RS 4n
 490 Block device
 491 .RE
 492 
 493 .sp
 494 .ne 2
 495 .na
 496 \fB\fBcd\fR\fR
 497 .ad
 498 .sp .6
 499 .RS 4n
 500 Character device
 501 .RE
 502 
 503 .sp
 504 .ne 2
 505 .na
 506 \fB\fBex\fR\fR
 507 .ad
 508 .sp .6
 509 .RS 4n
 510 Execute bit (either \fBuser\fR, \fBgroup\fR, or \fBother\fR) set
 511 .RE
 512 
 513 .sp
 514 .ne 2
 515 .na
 516 \fB\fBpo\fR\fR
 517 .ad
 518 .sp .6
 519 .RS 4n
 520 Event port
 521 .RE
 522 
 523 .sp
 524 .ne 2
 525 .na
 526 \fB\fBst\fR\fR
 527 .ad
 528 .sp .6
 529 .RS 4n
 530 Sticky bit set
 531 .RE
 532 
 533 .sp
 534 .ne 2
 535 .na
 536 \fB\fBor\fR\fR
 537 .ad
 538 .sp .6
 539 .RS 4n
 540 Orphaned symlink
 541 .RE
 542 
 543 .sp
 544 .ne 2
 545 .na
 546 \fB\fBsg\fR\fR
 547 .ad
 548 .sp .6
 549 .RS 4n
 550 \fBsetgid\fR binary
 551 .RE
 552 
 553 .sp
 554 .ne 2
 555 .na
 556 \fB\fBsu\fR\fR
 557 .ad
 558 .sp .6
 559 .RS 4n
 560 \fBsetuid\fR binary
 561 .RE
 562 
 563 .sp
 564 .ne 2
 565 .na
 566 \fB\fBow\fR\fR
 567 .ad
 568 .sp .6
 569 .RS 4n
 570 \fBworld\fR writable
 571 .RE
 572 
 573 .sp
 574 .ne 2
 575 .na
 576 \fB\fBtw\fR\fR
 577 .ad
 578 .sp .6
 579 .RS 4n
 580 Sticky bit and \fBworld\fR writable
 581 .RE
 582 
 583 .sp
 584 .LP
 585 \fIattr\fR is a semicolon delimited list of color and display attributes which
 586 are combined to determine the final output color. Any combination of \fIattr\fR
 587 values can be specified. Possible \fIattr\fR values are:
 588 .sp
 589 .ne 2
 590 .na
 591 \fB\fB00\fR\fR
 592 .ad
 593 .sp .6
 594 .RS 4n
 595 All attributes off (default terminal color)
 596 .RE
 597 
 598 .sp
 599 .ne 2
 600 .na
 601 \fB\fB01\fR\fR
 602 .ad
 603 .sp .6
 604 .RS 4n
 605 Display text in bold
 606 .RE
 607 
 608 .sp
 609 .ne 2
 610 .na
 611 \fB\fB04\fR\fR
 612 .ad
 613 .sp .6
 614 .RS 4n
 615 Display text with an underscore
 616 .RE
 617 
 618 .sp
 619 .ne 2
 620 .na
 621 \fB\fB05\fR\fR
 622 .ad
 623 .sp .6
 624 .RS 4n
 625 Display text in bold
 626 .RE
 627 
 628 .sp
 629 .ne 2
 630 .na
 631 \fB\fB07\fR\fR
 632 .ad
 633 .sp .6
 634 .RS 4n
 635 Display text with foreground and background colors reversed
 636 .RE
 637 
 638 .sp
 639 .ne 2
 640 .na
 641 \fB\fB08\fR\fR
 642 .ad
 643 .sp .6
 644 .RS 4n
 645 Display using concealed text.
 646 .RE
 647 
 648 .sp
 649 .LP
 650 One of the following values can be chosen. If multiple values are specified,
 651 the last specified value is used.
 652 .sp
 653 .ne 2
 654 .na
 655 \fB\fB30\fR\fR
 656 .ad
 657 .sp .6
 658 .RS 4n
 659 Set foreground to \fBblack\fR.
 660 .RE
 661 
 662 .sp
 663 .ne 2
 664 .na
 665 \fB\fB31\fR\fR
 666 .ad
 667 .sp .6
 668 .RS 4n
 669 Set foreground to \fBred\fR.
 670 .RE
 671 
 672 .sp
 673 .ne 2
 674 .na
 675 \fB\fB32\fR\fR
 676 .ad
 677 .sp .6
 678 .RS 4n
 679 Set foreground to \fBgreen\fR.
 680 .RE
 681 
 682 .sp
 683 .ne 2
 684 .na
 685 \fB\fB33\fR\fR
 686 .ad
 687 .sp .6
 688 .RS 4n
 689 Set foreground to \fByellow\fR.
 690 .RE
 691 
 692 .sp
 693 .ne 2
 694 .na
 695 \fB\fB34\fR\fR
 696 .ad
 697 .sp .6
 698 .RS 4n
 699 Set foreground to \fBblue\fR.
 700 .RE
 701 
 702 .sp
 703 .ne 2
 704 .na
 705 \fB\fB35\fR\fR
 706 .ad
 707 .sp .6
 708 .RS 4n
 709 Set foreground to \fBmagenta\fR (\fBpurple\fR).
 710 .sp
 711 Set foreground to \fB\fR.
 712 .RE
 713 
 714 .sp
 715 .ne 2
 716 .na
 717 \fB\fB36\fR\fR
 718 .ad
 719 .sp .6
 720 .RS 4n
 721 Set foreground to \fBcyan\fR.
 722 .RE
 723 
 724 .sp
 725 .ne 2
 726 .na
 727 \fB\fB37\fR\fR
 728 .ad
 729 .sp .6
 730 .RS 4n
 731 Set foreground to \fBwhite\fR.
 732 .RE
 733 
 734 .sp
 735 .ne 2
 736 .na
 737 \fB\fB39\fR\fR
 738 .ad
 739 .sp .6
 740 .RS 4n
 741 Set foreground to default terminal color.
 742 .RE
 743 
 744 .sp
 745 .LP
 746 One of the following can be specified. If multiple values are specified, the
 747 last value specified is used.
 748 .sp
 749 .ne 2
 750 .na
 751 \fB\fB40\fR\fR
 752 .ad
 753 .sp .6
 754 .RS 4n
 755 Set foreground to \fBblack\fR.
 756 .RE
 757 
 758 .sp
 759 .ne 2
 760 .na
 761 \fB\fB41\fR\fR
 762 .ad
 763 .sp .6
 764 .RS 4n
 765 Set foreground to \fBred\fR.
 766 .RE
 767 
 768 .sp
 769 .ne 2
 770 .na
 771 \fB\fB42\fR\fR
 772 .ad
 773 .sp .6
 774 .RS 4n
 775 Set foreground to \fBgreen\fR.
 776 .RE
 777 
 778 .sp
 779 .ne 2
 780 .na
 781 \fB\fB43\fR\fR
 782 .ad
 783 .sp .6
 784 .RS 4n
 785 Set foreground to \fByellow\fR.
 786 .RE
 787 
 788 .sp
 789 .ne 2
 790 .na
 791 \fB\fB44\fR\fR
 792 .ad
 793 .sp .6
 794 .RS 4n
 795 Set foreground to \fBblue\fR.
 796 .RE
 797 
 798 .sp
 799 .ne 2
 800 .na
 801 \fB\fB45\fR\fR
 802 .ad
 803 .sp .6
 804 .RS 4n
 805 Set foreground to \fBmagenta\fR (\fBpurple\fR).
 806 .RE
 807 
 808 .sp
 809 .ne 2
 810 .na
 811 \fB\fB46\fR\fR
 812 .ad
 813 .sp .6
 814 .RS 4n
 815 Set foreground to \fBcyan\fR.
 816 .RE
 817 
 818 .sp
 819 .ne 2
 820 .na
 821 \fB\fB47\fR\fR
 822 .ad
 823 .sp .6
 824 .RS 4n
 825 Set foreground to \fBwhite\fR.
 826 .RE
 827 
 828 .sp
 829 .ne 2
 830 .na
 831 \fB\fB49\fR\fR
 832 .ad
 833 .sp .6
 834 .RS 4n
 835 Set foreground to default terminal color.
 836 .RE
 837 
 838 .sp
 839 .LP
 840 On some terminals, setting the bold attribute causes the foreground colors to
 841 be high-intensity, that is, brighter. In such cases the low-intensity yellow is
 842 often displayed as a brown or orange color.
 843 .sp
 844 .LP
 845 At least one attribute must be listed for a file specification.
 846 .sp
 847 .LP
 848 The appropriate color codes are chosen by selecting the most specific match,
 849 starting with the file suffixes and proceeding with the file types until a
 850 match is found. The \fBno\fR (normal file) type matches any file.
 851 .SH OPTIONS
 852 .LP
 853 The following options are supported:
 854 .SS "/usr/bin/ls, /usr/xpg4/bin/ls, and /usr/xpg6/bin/ls"
 855 .LP
 856 The following options are supported for all three versions:
 857 .sp
 858 .ne 2
 859 .na
 860 \fB\fB-a\fR\fR
 861 .ad
 862 .br
 863 .na
 864 \fB\fB--all\fR\fR
 865 .ad
 866 .sp .6
 867 .RS 4n
 868 Lists all entries, including those that begin with a dot (\fB\&.\fR), which are
 869 normally not listed.
 870 .RE
 871 
 872 .sp
 873 .ne 2
 874 .na
 875 \fB\fB-A\fR\fR
 876 .ad
 877 .br
 878 .na
 879 \fB\fB--almost-all\fR\fR
 880 .ad
 881 .sp .6
 882 .RS 4n
 883 Lists all entries, including those that begin with a dot (\fB\&.\fR), with the
 884 exception of the working directory (\fB\&.\fR) and the parent directory
 885 (\fB\&..\fR).
 886 .RE
 887 
 888 .sp
 889 .ne 2
 890 .na
 891 \fB\fB-b\fR\fR
 892 .ad
 893 .br
 894 .na
 895 \fB\fB--escape\fR\fR
 896 .ad
 897 .sp .6
 898 .RS 4n
 899 Forces printing of non-printable characters to be in the octal
 900 \fB\e\fR\fIddd\fR notation.
 901 .RE
 902 
 903 .sp
 904 .ne 2
 905 .na
 906 \fB\fB-B\fR\fR
 907 .ad
 908 .br
 909 .na
 910 \fB\fB--ignore-backups\fR\fR
 911 .ad
 912 .sp .6
 913 .RS 4n
 914 Do not display any files ending with a tilde (\fB~\fR).
 915 .RE
 916 
 917 .sp
 918 .ne 2
 919 .na
 920 \fB\fB-c\fR\fR
 921 .ad
 922 .sp .6
 923 .RS 4n
 924 Uses time of last modification of the i-node (file created, mode changed, and
 925 so forth) for sorting (\fB-t\fR) or printing (\fB-l\fR or \fB-n\fR).
 926 .RE
 927 
 928 .sp
 929 .ne 2
 930 .na
 931 \fB\fB-C\fR\fR
 932 .ad
 933 .sp .6
 934 .RS 4n
 935 Multi-column output with entries sorted down the columns. This is the default
 936 output format.
 937 .RE
 938 
 939 .sp
 940 .ne 2
 941 .na
 942 \fB\fB-d\fR\fR
 943 .ad
 944 .sp .6
 945 .RS 4n
 946 If an argument is a directory, lists only its name (not its contents). Often
 947 used with \fB-l\fR to get the status of a directory.
 948 .RE
 949 
 950 .sp
 951 .ne 2
 952 .na
 953 \fB\fB-e\fR\fR
 954 .ad
 955 .sp .6
 956 .RS 4n
 957 The same as \fB-l\fR, except displays time to the second, and with one format
 958 for all files regardless of age: \fImmm dd hh:mm:ss yyyy\fR.
 959 .RE
 960 
 961 .sp
 962 .ne 2
 963 .na
 964 \fB\fB-E\fR\fR
 965 .ad
 966 .sp .6
 967 .RS 4n
 968 The same as \fB-l\fR, except displays time to the nanosecond and with one
 969 format for all files regardless of age: \fIyyyy-mm-dd hh:mm:ss.nnnnnnnnn\fR
 970 (ISO 8601:2000 format).
 971 .sp
 972 In addition, this option displays the offset from UTC in ISO 8601:2000 standard
 973 format (+\fIhhmm\fR or -\fIhhmm\fR) or no characters if the offset is
 974 indeterminable. The offset reflects the appropriate standard or alternate
 975 offset in force at the file's displayed date and time, under the current
 976 timezone.
 977 .RE
 978 
 979 .sp
 980 .ne 2
 981 .na
 982 \fB\fB-f\fR\fR
 983 .ad
 984 .sp .6
 985 .RS 4n
 986 Forces each argument to be interpreted as a directory and list the name found
 987 in each slot. This option turns off \fB-l\fR, \fB-t\fR, \fB-s\fR, \fB-S\fR, and
 988 \fB-r\fR, and turns on \fB-a\fR. The order is the order in which entries appear
 989 in the directory.
 990 .RE
 991 
 992 .sp
 993 .ne 2
 994 .na
 995 \fB\fB-F\fR\fR
 996 .ad
 997 .br
 998 .na
 999 \fB\fB--classify\fR\fR
1000 .ad
1001 .sp .6
1002 .RS 4n
1003 Append a symbol after certain types of files to indicate the file type. The
1004 following symbols are used:
1005 .sp
1006 .ne 2
1007 .na
1008 \fB\fB/\fR\fR
1009 .ad
1010 .sp .6
1011 .RS 4n
1012 Directory
1013 .RE
1014 
1015 .sp
1016 .ne 2
1017 .na
1018 \fB\fB>\fR\fR
1019 .ad
1020 .sp .6
1021 .RS 4n
1022 Door file
1023 .RE
1024 
1025 .sp
1026 .ne 2
1027 .na
1028 \fB\fB|\fR\fR
1029 .ad
1030 .sp .6
1031 .RS 4n
1032 Named pipe (\fBFIFO\fR)
1033 .RE
1034 
1035 .sp
1036 .ne 2
1037 .na
1038 \fB\fB@\fR\fR
1039 .ad
1040 .sp .6
1041 .RS 4n
1042 Symbolic link
1043 .RE
1044 
1045 .sp
1046 .ne 2
1047 .na
1048 \fB\fB=\fR\fR
1049 .ad
1050 .sp .6
1051 .RS 4n
1052 Socket
1053 .RE
1054 
1055 .sp
1056 .ne 2
1057 .na
1058 \fB\fB*\fR\fR
1059 .ad
1060 .sp .6
1061 .RS 4n
1062 Executable
1063 .RE
1064 
1065 .RE
1066 
1067 .sp
1068 .ne 2
1069 .na
1070 \fB\fB-g\fR\fR
1071 .ad
1072 .sp .6
1073 .RS 4n
1074 The same as \fB-l\fR, except that the owner is not printed.
1075 .RE
1076 
1077 .sp
1078 .ne 2
1079 .na
1080 \fB\fB-h\fR\fR
1081 .ad
1082 .br
1083 .na
1084 \fB\fB--human-readable\fR\fR
1085 .ad
1086 .sp .6
1087 .RS 4n
1088 All sizes are scaled to a human readable format, for example, \fB14K\fR,
1089 \fB234M\fR, \fB2.7G\fR, or \fB3.0T\fR. Scaling is done by repetitively dividing
1090 by \fB1024\fR. The last --si or -h option determines the divisor used.
1091 .RE
1092 
1093 .sp
1094 .ne 2
1095 .na
1096 \fB\fB-H\fR\fR
1097 .ad
1098 .br
1099 .na
1100 \fB\fB--dereference-command-line\fR\fR
1101 .ad
1102 .sp .6
1103 .RS 4n
1104 If an argument is a symbolic link that references a directory, this option
1105 evaluates the file information and file type of the directory that the link
1106 references, rather than those of the link itself. However, the name of the link
1107 is displayed, rather than the referenced directory.
1108 .RE
1109 
1110 .sp
1111 .ne 2
1112 .na
1113 \fB\fB-i\fR\fR
1114 .ad
1115 .br
1116 .na
1117 \fB\fB--inode\fR\fR
1118 .ad
1119 .sp .6
1120 .RS 4n
1121 For each file, prints the i-node number in the first column of the report.
1122 .RE
1123 
1124 .sp
1125 .ne 2
1126 .na
1127 \fB\fB-k\fR\fR
1128 .ad
1129 .sp .6
1130 .RS 4n
1131 All sizes are printed in kbytes. Equivalent to --block-size=1024.
1132 .RE
1133 
1134 .sp
1135 .ne 2
1136 .na
1137 \fB\fB-l\fR\fR
1138 .ad
1139 .sp .6
1140 .RS 4n
1141 Lists in long format, giving mode, \fBACL\fR indication, number of links,
1142 owner, group, size in bytes, and time of last modification for each file (see
1143 above). If the file is a special file, the size field instead contains the
1144 major and minor device numbers. If the time of last modification is greater
1145 than six months ago, it is shown in the format `month date year' for the POSIX
1146 locale. When the \fBLC_TIME\fR locale category is not set to the POSIX locale,
1147 a different format of the time field can be used. Files modified within six
1148 months show `month date time'. If the file is a symbolic link, the filename is
1149 printed followed by "\fB\(->\fR" and the path name of the referenced file.
1150 .RE
1151 
1152 .sp
1153 .ne 2
1154 .na
1155 \fB\fB-L\fR\fR
1156 .ad
1157 .br
1158 .na
1159 \fB\fB--dereference\fR\fR
1160 .ad
1161 .sp .6
1162 .RS 4n
1163 If an argument is a symbolic link, this option evaluates the file information
1164 and file type of the file or directory that the link references, rather than
1165 those of the link itself. However, the name of the link is displayed, rather
1166 than the referenced file or directory.
1167 .RE
1168 
1169 .sp
1170 .ne 2
1171 .na
1172 \fB\fB-m\fR\fR
1173 .ad
1174 .sp .6
1175 .RS 4n
1176 Streams output format. Files are listed across the page, separated by commas.
1177 .RE
1178 
1179 .sp
1180 .ne 2
1181 .na
1182 \fB\fB-n\fR\fR
1183 .ad
1184 .br
1185 .na
1186 \fB\fB--numeric-uid-gid\fR\fR
1187 .ad
1188 .sp .6
1189 .RS 4n
1190 The same as \fB-l\fR, except that the owner's \fBUID\fR and group's \fBGID\fR
1191 numbers are printed, rather than the associated character strings.
1192 .RE
1193 
1194 .sp
1195 .ne 2
1196 .na
1197 \fB\fB-o\fR\fR
1198 .ad
1199 .br
1200 .na
1201 \fB\fB--no-group\fR\fR
1202 .ad
1203 .sp .6
1204 .RS 4n
1205 The same as \fB-l\fR, except that the group is not printed.
1206 .RE
1207 
1208 .sp
1209 .ne 2
1210 .na
1211 \fB\fB-p\fR\fR
1212 .ad
1213 .sp .6
1214 .RS 4n
1215 Puts a slash (\fB/\fR) after each filename if the file is a directory.
1216 .RE
1217 
1218 .sp
1219 .ne 2
1220 .na
1221 \fB\fB-q\fR\fR
1222 .ad
1223 .br
1224 .na
1225 \fB\fB--hide-control-chars\fR\fR
1226 .ad
1227 .sp .6
1228 .RS 4n
1229 Forces printing of non-printable characters in file names as the character
1230 question mark (\fB?\fR).
1231 .RE
1232 
1233 .sp
1234 .ne 2
1235 .na
1236 \fB\fB-r\fR\fR
1237 .ad
1238 .br
1239 .na
1240 \fB\fB--reverse\fR\fR
1241 .ad
1242 .sp .6
1243 .RS 4n
1244 Reverses the order of sort to get reverse alphabetic, oldest first, or smallest
1245 file size first as appropriate.
1246 .RE
1247 
1248 .sp
1249 .ne 2
1250 .na
1251 \fB\fB-R\fR\fR
1252 .ad
1253 .br
1254 .na
1255 \fB\fB--recursive\fR\fR
1256 .ad
1257 .sp .6
1258 .RS 4n
1259 Recursively lists subdirectories encountered.
1260 .RE
1261 
1262 .sp
1263 .ne 2
1264 .na
1265 \fB\fB-s\fR\fR
1266 .ad
1267 .br
1268 .na
1269 \fB\fB--size\fR\fR
1270 .ad
1271 .sp .6
1272 .RS 4n
1273 Indicate the total number of file system blocks consumed by each file
1274 displayed.
1275 .RE
1276 
1277 .sp
1278 .ne 2
1279 .na
1280 \fB\fB-S\fR\fR
1281 .ad
1282 .sp .6
1283 .RS 4n
1284 Sort by file size (in decreasing order) and for files with the same size by
1285 file name (in increasing alphabetic order) instead of just by name.
1286 .RE
1287 
1288 .sp
1289 .ne 2
1290 .na
1291 \fB\fB-t\fR\fR
1292 .ad
1293 .sp .6
1294 .RS 4n
1295 Sorts by time stamp (latest first) instead of by name. The default is the last
1296 modification time. See \fB-c\fR, \fB-u\fR and \fB-%\fR.
1297 .RE
1298 
1299 .sp
1300 .ne 2
1301 .na
1302 \fB\fB-u\fR\fR
1303 .ad
1304 .sp .6
1305 .RS 4n
1306 Uses time of last access instead of last modification for sorting (with the
1307 \fB-t\fR option) or printing (with the \fB-l\fR option).
1308 .RE
1309 
1310 .sp
1311 .ne 2
1312 .na
1313 \fB\fB-U\fR\fR
1314 .ad
1315 .sp .6
1316 .RS 4n
1317 Output is unsorted.
1318 .RE
1319 
1320 .sp
1321 .ne 2
1322 .na
1323 \fB\fB-v\fR\fR
1324 .ad
1325 .sp .6
1326 .RS 4n
1327 The same as \fB-l\fR, except that verbose ACL information is displayed as well
1328 as the \fB-l\fR output. ACL information is displayed even if the file or
1329 directory doesn't have an ACL.
1330 .RE
1331 
1332 .sp
1333 .ne 2
1334 .na
1335 \fB\fB-V\fR\fR
1336 .ad
1337 .sp .6
1338 .RS 4n
1339 The same as \fB-l\fR, except that compact ACL information is displayed after
1340 the \fB-l\fR output.
1341 .sp
1342 The \fB-V\fR option is only applicable to file systems that support NFSv4 ACLs,
1343 such as the Solaris ZFS file system.
1344 .sp
1345 The format of the displayed ACL is as follows:
1346 .sp
1347 .in +2
1348 .nf
1349 \fIentry_type\fR : \fIpermissions\fR : \fIinheritance_flags\fR : \fIaccess_type\fR
1350 .fi
1351 .in -2
1352 .sp
1353 
1354 \fIentry_type\fR is displayed as one of the following:
1355 .sp
1356 .ne 2
1357 .na
1358 \fBuser:\fIusername\fR\fR
1359 .ad
1360 .sp .6
1361 .RS 4n
1362 Additional user access for \fIusername\fR.
1363 .RE
1364 
1365 .sp
1366 .ne 2
1367 .na
1368 \fBgroup:\fIgroupname\fR\fR
1369 .ad
1370 .sp .6
1371 .RS 4n
1372 Additional group access for group \fIgroupname\fR.
1373 .RE
1374 
1375 .sp
1376 .ne 2
1377 .na
1378 \fBowner@\fR
1379 .ad
1380 .sp .6
1381 .RS 4n
1382 File owner.
1383 .RE
1384 
1385 .sp
1386 .ne 2
1387 .na
1388 \fBgroup@\fR
1389 .ad
1390 .sp .6
1391 .RS 4n
1392 File group owner.
1393 .RE
1394 
1395 .sp
1396 .ne 2
1397 .na
1398 \fBeveryone@\fR
1399 .ad
1400 .sp .6
1401 .RS 4n
1402 Everyone access, including file owner and file group owner. This is not
1403 equivalent to the POSIX other class.
1404 .RE
1405 
1406 The following permissions, supported by the NFSv4 ACL model, are displayed by
1407 using the \fB-v\fR or \fB-V\fR options:
1408 .sp
1409 .ne 2
1410 .na
1411 \fBread_data (\fBr\fR)\fR
1412 .ad
1413 .sp .6
1414 .RS 4n
1415 Permission to read the data of a file.
1416 .RE
1417 
1418 .sp
1419 .ne 2
1420 .na
1421 \fBlist_directory (\fBr\fR)\fR
1422 .ad
1423 .sp .6
1424 .RS 4n
1425 Permission to list the contents of a directory.
1426 .RE
1427 
1428 .sp
1429 .ne 2
1430 .na
1431 \fBwrite_data (\fBw\fR)\fR
1432 .ad
1433 .sp .6
1434 .RS 4n
1435 Permission to modify a file's data. anywhere in the file's offset range.
1436 .RE
1437 
1438 .sp
1439 .ne 2
1440 .na
1441 \fBadd_file (\fBw\fR)\fR
1442 .ad
1443 .sp .6
1444 .RS 4n
1445 Permission to add a new file to a directory.
1446 .RE
1447 
1448 .sp
1449 .ne 2
1450 .na
1451 \fBappend_data (\fBp\fR)\fR
1452 .ad
1453 .sp .6
1454 .RS 4n
1455 The ability to modify a file's data, but only starting at EOF.
1456 .RE
1457 
1458 .sp
1459 .ne 2
1460 .na
1461 \fBadd_subdirectory (\fBp\fR)\fR
1462 .ad
1463 .sp .6
1464 .RS 4n
1465 Permission to create a subdirectory to a directory.
1466 .RE
1467 
1468 .sp
1469 .ne 2
1470 .na
1471 \fBread_xattr (\fBR\fR)\fR
1472 .ad
1473 .sp .6
1474 .RS 4n
1475 Ability to read the extended attributes of a file.
1476 .RE
1477 
1478 .sp
1479 .ne 2
1480 .na
1481 \fBwrite_xattr (\fBW\fR)\fR
1482 .ad
1483 .sp .6
1484 .RS 4n
1485 Ability to create extended attributes or write to the extended attribute
1486 directory.
1487 .RE
1488 
1489 .sp
1490 .ne 2
1491 .na
1492 \fBexecute (\fBx\fR)\fR
1493 .ad
1494 .sp .6
1495 .RS 4n
1496 Permission to execute a file.
1497 .RE
1498 
1499 .sp
1500 .ne 2
1501 .na
1502 \fBread_attributes (\fBa\fR)\fR
1503 .ad
1504 .sp .6
1505 .RS 4n
1506 The ability to read basic attributes (non-ACLs) of a file.
1507 .RE
1508 
1509 .sp
1510 .ne 2
1511 .na
1512 \fBwrite_attributes (\fBA\fR)\fR
1513 .ad
1514 .sp .6
1515 .RS 4n
1516 Permission to change the times associated with a file or directory to an
1517 arbitrary value.
1518 .RE
1519 
1520 .sp
1521 .ne 2
1522 .na
1523 \fBdelete (\fBd\fR)\fR
1524 .ad
1525 .sp .6
1526 .RS 4n
1527 Permission to delete a file.
1528 .RE
1529 
1530 .sp
1531 .ne 2
1532 .na
1533 \fBdelete_child (\fBD\fR)\fR
1534 .ad
1535 .sp .6
1536 .RS 4n
1537 Permission to delete a file within a directory.
1538 .RE
1539 
1540 .sp
1541 .ne 2
1542 .na
1543 \fBread_acl (\fBc\fR)\fR
1544 .ad
1545 .sp .6
1546 .RS 4n
1547 Permission to read the ACL of a file.
1548 .RE
1549 
1550 .sp
1551 .ne 2
1552 .na
1553 \fBwrite_acl (\fBC\fR)\fR
1554 .ad
1555 .sp .6
1556 .RS 4n
1557 Permission to write the ACL of a file.
1558 .RE
1559 
1560 .sp
1561 .ne 2
1562 .na
1563 \fBwrite_owner (\fBo\fR)\fR
1564 .ad
1565 .sp .6
1566 .RS 4n
1567 Permission to change the owner of a file.
1568 .RE
1569 
1570 .sp
1571 .ne 2
1572 .na
1573 \fBsynchronize (\fBs\fR)\fR
1574 .ad
1575 .sp .6
1576 .RS 4n
1577 Permission to access file locally at server with synchronize reads and writes.
1578 .RE
1579 
1580 .sp
1581 .ne 2
1582 .na
1583 \fB\fB-\fR\fR
1584 .ad
1585 .sp .6
1586 .RS 4n
1587 No permission granted
1588 .RE
1589 
1590 The following inheritance flags, supported by the NFSv4 ACL model, are
1591 displayed by using the \fB-v\fR or \fB-V\fR options:
1592 .sp
1593 .ne 2
1594 .na
1595 \fBfile_inherit (\fBf\fR)\fR
1596 .ad
1597 .sp .6
1598 .RS 4n
1599 Inherit to all newly created files.
1600 .RE
1601 
1602 .sp
1603 .ne 2
1604 .na
1605 \fBdir_inherit (\fBd\fR)\fR
1606 .ad
1607 .sp .6
1608 .RS 4n
1609 Inherit to all newly created directories.
1610 .RE
1611 
1612 .sp
1613 .ne 2
1614 .na
1615 \fBinherit_only (\fBi\fR)\fR
1616 .ad
1617 .sp .6
1618 .RS 4n
1619 When placed on a directory, do not apply to the directory, only to newly
1620 created files and directories. This flag requires that either
1621 \fBfile_inherit\fR and or \fBdir_inherit\fR is also specified.
1622 .RE
1623 
1624 .sp
1625 .ne 2
1626 .na
1627 \fBno_propagate (\fBn\fR)\fR
1628 .ad
1629 .sp .6
1630 .RS 4n
1631 Indicates that ACL entries should be inherited to objects in a directory, but
1632 inheritance should stop after descending one level. This flag is dependent upon
1633 either \fBfile_inherit\fR and or \fBdir_inherit\fR also being specified.
1634 .RE
1635 
1636 .sp
1637 .ne 2
1638 .na
1639 \fBsuccessful_access (\fBS\fR)\fR
1640 .ad
1641 .sp .6
1642 .RS 4n
1643 Indicates whether an alarm or audit record should be initiated upon successful
1644 accesses. Used with audit/alarm ACE types.
1645 .RE
1646 
1647 .sp
1648 .ne 2
1649 .na
1650 \fBfailed_access (\fBF\fR)\fR
1651 .ad
1652 .sp .6
1653 .RS 4n
1654 Indicates whether an alarm or audit record should be initiated when access
1655 fails. Used with audit/alarm ACE types.
1656 .RE
1657 
1658 .sp
1659 .ne 2
1660 .na
1661 \fBinherited (\fBI\fR)\fR
1662 .ad
1663 .sp .6
1664 .RS 4n
1665 ACE was inherited.
1666 .RE
1667 
1668 .sp
1669 .ne 2
1670 .na
1671 \fB\fB-\fR\fR
1672 .ad
1673 .sp .6
1674 .RS 4n
1675 No permission granted.
1676 .RE
1677 
1678 \fIaccess_type\fR is displayed as one of the following types:
1679 .sp
1680 .ne 2
1681 .na
1682 \fBalarm\fR
1683 .ad
1684 .RS 9n
1685 Permission field that specifies permissions that should trigger an alarm.
1686 .RE
1687 
1688 .sp
1689 .ne 2
1690 .na
1691 \fBallow\fR
1692 .ad
1693 .RS 9n
1694 Permission field that specifies allow permissions.
1695 .RE
1696 
1697 .sp
1698 .ne 2
1699 .na
1700 \fBaudit\fR
1701 .ad
1702 .RS 9n
1703 Permission field that specifies permissions that should be audited.
1704 .RE
1705 
1706 .sp
1707 .ne 2
1708 .na
1709 \fBdeny\fR
1710 .ad
1711 .RS 9n
1712 Permission field that specifies deny permissions.
1713 .RE
1714 
1715 For example:
1716 .sp
1717 .in +2
1718 .nf
1719 $ ls -dV /sandbox/dir.1
1720   drwxr-xr-x+  2 root     root           2 Jan 17 15:09 dir.1
1721                   user:marks:r-------------:fd-----:allow
1722                       owner@:--------------:-------:deny
1723                       owner@:rwxp---A-W-Co-:-------:allow
1724                       group@:-w-p----------:-------:deny
1725                       group@:r-x-----------:-------:allow
1726                    everyone@:-w-p---A-W-Co-:-------:deny
1727                    everyone@:r-x---a-R-c--s:-------:allow
1728 $
1729                            ||||||||||||||||:||||||+ inherited access
1730                              ||||||||||||||:||||||+ failed access
1731                              ||||||||||||||:|||||+--success access
1732                              ||||||||||||||:||||+-- no propagate
1733                              ||||||||||||||:|||+--- inherit only
1734                              ||||||||||||||:||+---- directory inherit
1735                              ||||||||||||||:|+----- file inherit
1736                              ||||||||||||||
1737                              ||||||||||||||+ sync
1738                              |||||||||||||+- change owner
1739                              ||||||||||||+-- write ACL
1740                              |||||||||||+--- read ACL
1741                              ||||||||||+---- write extended attributes
1742                              |||||||||+----- read extended attributes
1743                              ||||||||+------ write attributes
1744                              |||||||+------- read attributes
1745                              ||||||+-------- delete child
1746                              |||||+--------- delete
1747                              ||||+---------- append
1748                              |||+----------- execute
1749                              ||+------------ write data
1750                              |+------------- read data
1751 .fi
1752 .in -2
1753 .sp
1754 
1755 .RE
1756 
1757 .sp
1758 .ne 2
1759 .na
1760 \fB\fB-w\fR \fIcols\fR\fR
1761 .ad
1762 .br
1763 .na
1764 \fB\fB--width\fR \fIcols\fR\fR
1765 .ad
1766 .sp .6
1767 .RS 4n
1768 Multi-column output where the column width is forced to \fIcols\fR.
1769 .RE
1770 
1771 .sp
1772 .ne 2
1773 .na
1774 \fB\fB-x\fR\fR
1775 .ad
1776 .sp .6
1777 .RS 4n
1778 Multi-column output with entries sorted across rather than down the page.
1779 .RE
1780 
1781 .sp
1782 .ne 2
1783 .na
1784 \fB\fB-1\fR\fR
1785 .ad
1786 .sp .6
1787 .RS 4n
1788 Prints one entry per line of output.
1789 .RE
1790 
1791 .sp
1792 .ne 2
1793 .na
1794 \fB\fB-@\fR\fR
1795 .ad
1796 .sp .6
1797 .RS 4n
1798 The same as \fB-l\fR, except that extended attribute information overrides
1799 \fBACL\fR information. An \fB@\fR is displayed after the file permission bits
1800 for files that have extended attributes.
1801 .RE
1802 
1803 .sp
1804 .ne 2
1805 .na
1806 \fB\fB-/ c\fR | \fBv\fR\fR
1807 .ad
1808 .sp .6
1809 .RS 4n
1810 The same as \fB-l\fR, and in addition displays the extended system attributes
1811 associated with the file when extended system attributes are fully supported by
1812 the underlying file system. The option \fB-/\fR supports two option arguments
1813 \fBc\fR (compact mode) and \fBv\fR (verbose mode).
1814 .sp
1815 .ne 2
1816 .na
1817 \fB\fBappendonly\fR\fR
1818 .ad
1819 .sp .6
1820 .RS 4n
1821 Allows a file to be modified only at offset \fBEOF\fR. Attempts to modify a
1822 file at a location other than \fBEOF\fR fails with \fBEPERM\fR.
1823 .RE
1824 
1825 .sp
1826 .ne 2
1827 .na
1828 \fB\fBarchive\fR\fR
1829 .ad
1830 .sp .6
1831 .RS 4n
1832 Indicates if a file has been modified since it was last backed up. Whenever the
1833 modification time (\fBmtime\fR) of a file is changed the \fBarchive\fR
1834 attribute is set.
1835 .RE
1836 
1837 .sp
1838 .ne 2
1839 .na
1840 \fB\fBav_modified\fR\fR
1841 .ad
1842 .sp .6
1843 .RS 4n
1844 ZFS sets the anti-virus attribute which whenever a file's content or size
1845 changes or when the file is renamed.
1846 .RE
1847 
1848 .sp
1849 .ne 2
1850 .na
1851 \fB\fBav_quarantined\fR\fR
1852 .ad
1853 .sp .6
1854 .RS 4n
1855 Anti-virus software sets to mark a file as quarantined.
1856 .RE
1857 
1858 .sp
1859 .ne 2
1860 .na
1861 \fB\fBcrtime\fR\fR
1862 .ad
1863 .sp .6
1864 .RS 4n
1865 Timestamp when a file is created.
1866 .RE
1867 
1868 .sp
1869 .ne 2
1870 .na
1871 \fB\fBhidden\fR\fR
1872 .ad
1873 .sp .6
1874 .RS 4n
1875 Marks a file as hidden.
1876 .RE
1877 
1878 .sp
1879 .ne 2
1880 .na
1881 \fB\fBimmutable\fR\fR
1882 .ad
1883 .sp .6
1884 .RS 4n
1885 Prevents the content of a file from being modified. Also prevents all metadata
1886 changes, except for access time updates. When placed on a directory, prevents
1887 the deletion and creation of files in the directories. Attempts to modify the
1888 content of a file or directory marked as \fBimmutable\fR fail with \fBEPERM\fR.
1889 Attempts to modify any attributes (with the exception of access time and, with
1890 the proper privileges, the \fBimmutable\fR) of a file marked as \fBimmutable\fR
1891 fails with \fBEPERM\fR.
1892 .RE
1893 
1894 .sp
1895 .ne 2
1896 .na
1897 \fB\fBnodump\fR\fR
1898 .ad
1899 .sp .6
1900 .RS 4n
1901 Solaris systems have no special semantics for this attribute.
1902 .RE
1903 
1904 .sp
1905 .ne 2
1906 .na
1907 \fB\fBnounlink\fR\fR
1908 .ad
1909 .sp .6
1910 .RS 4n
1911 Prevents a file from being deleted. On a directory, the attribute also prevents
1912 any changes to the contents of the directory. That is, no files within the
1913 directory can be removed or renamed. The \fBerrno\fR \fBEPERM\fR is returned
1914 when attempting to unlink or rename files and directories that are marked as
1915 \fBnounlink\fR.
1916 .RE
1917 
1918 .sp
1919 .ne 2
1920 .na
1921 \fB\fBoffline\fR\fR
1922 .ad
1923 .sp .6
1924 .RS 4n
1925 Indicate that a file is offline.  Solaris systems have no special semantics for
1926 this attribute.
1927 .RE
1928 
1929 .sp
1930 .ne 2
1931 .na
1932 \fB\fBreadonly\fR\fR
1933 .ad
1934 .sp .6
1935 .RS 4n
1936 Marks a file as \fBreadonly\fR. Once a file is marked as \fBreadonly\fR the
1937 content data of the file cannot be modified. Other metadata for the file can
1938 still be modified.
1939 .RE
1940 
1941 .sp
1942 .ne 2
1943 .na
1944 \fB\fBsparse\fR\fR
1945 .ad
1946 .sp .6
1947 .RS 4n
1948 Indicate that a file can be interpreted as sparse.  It does not indicate that
1949 the file is actually sparse or not.  The sparse attribute is cleared when the
1950 file is truncated to zero length.  Solaris systems have no other special
1951 semantics for this attribute.
1952 .RE
1953 
1954 .sp
1955 .ne 2
1956 .na
1957 \fB\fBsystem\fR\fR
1958 .ad
1959 .sp .6
1960 .RS 4n
1961 Solaris systems have no special semantics for this attribute.
1962 .RE
1963 
1964 .RE
1965 
1966 .sp
1967 .LP
1968 The display characters used in compact mode (\fB-/ c\fR) are as follows:
1969 .sp
1970 .in +2
1971 .nf
1972 Attribute Name     Display
1973 archive            A
1974 hidden             H
1975 readonly           R
1976 system             S
1977 appendonly         a
1978 nodump             d
1979 immutable          i
1980 av_modified        m
1981 av_quarantined     q
1982 nounlink           u
1983 offline            O
1984 sparse             s
1985 .fi
1986 .in -2
1987 .sp
1988 
1989 .sp
1990 .LP
1991 The display in verbose mode (\fB-/ v\fR) uses full attribute names when it is set and
1992 the name prefixed by 'no' when it is not set.
1993 .sp
1994 .LP
1995 The attribute name \fBcrtime\fR and all other timestamps are handled by the
1996 option \fB-%\fR with the respective timestamp option arguments and also with
1997 \fBall\fR option argument. The display positions are as follows: The display in
1998 verbose mode (\fB-/ v\fR) uses full attribute names  when it is set and the
1999 name prefixed by \fBno\fR when it is not set. The attribute name \fBcrtime\fR
2000 and all other timestamps are handled by the option \fB-%\fR with the respective
2001 timestamp option arguments and also with \fBall\fR option argument.
2002 .sp
2003 .LP
2004 The display positions are as follows:
2005 .sp
2006 .in +2
2007 .nf
2008 {||||||||||||}
2009  |||||||||||+- s (sparse)
2010  ||||||||||+-- O (offline)
2011  |||||||||+--- u (nounlink)
2012  ||||||||+---- q (av_quarantined)
2013  |||||||+----- m (av_modified)
2014  ||||||+------ i (immutable)
2015  |||||+------- d (nodump)
2016  ||||+-------- a (appendonly)
2017  |||+--------- S (system)
2018  ||+---------- R (readonly)
2019  |+----------- H (hidden)
2020  +------------ A (archive)
2021 .fi
2022 .in -2
2023 .sp
2024 
2025 .sp
2026 .in +2
2027 .nf
2028 -% atime | crtime | ctime | mtime | all
2029 .fi
2030 .in -2
2031 .sp
2032 
2033 .sp
2034 .ne 2
2035 .na
2036 \fB\fBatime\fR\fR
2037 .ad
2038 .sp .6
2039 .RS 4n
2040 Equivalent to \fB-u\fR.
2041 .RE
2042 
2043 .sp
2044 .ne 2
2045 .na
2046 \fB\fBcrtime\fR\fR
2047 .ad
2048 .sp .6
2049 .RS 4n
2050 Uses the creation time of the file for sorting or printing.
2051 .RE
2052 
2053 .sp
2054 .ne 2
2055 .na
2056 \fB\fBctime\fR\fR
2057 .ad
2058 .sp .6
2059 .RS 4n
2060 Equivalent to \fB-c\fR.
2061 .RE
2062 
2063 .sp
2064 .ne 2
2065 .na
2066 \fB\fBmtime\fR\fR
2067 .ad
2068 .sp .6
2069 .RS 4n
2070 Uses the last modification time of the file contents for sorting or printing.
2071 .RE
2072 
2073 .sp
2074 .LP
2075 If extended system attributes are not supported or if the user does not have
2076 \fBread\fR permission on the file or if the \fBcrtime\fR extended attribute is
2077 not set, \fBcrtime\fR is treated as a synonym for \fBmtime\fR.
2078 .sp
2079 .LP
2080 When option argument \fBall\fR is specified, all available timestamps are
2081 printed which includes \fBatime\fR, \fBctime\fR, \fBmtime\fR and on the
2082 extended system attribute supporting file systems, \fBcrtime\fR (create time).
2083 The option \fB-% all\fR does not effect which timestamp is displayed in long
2084 format and does not affect sorting.
2085 .sp
2086 .ne 2
2087 .na
2088 \fB\fB--block-size\fR \fIsize\fR\fR
2089 .ad
2090 .sp .6
2091 .RS 4n
2092 Display sizes in multiples of size. Size can be scaled by suffixing one of
2093 \fBYyZzEePpTtGgMmKk\fR. Additionally, a \fBB\fR can be placed at the end to
2094 indicate powers of 10 instead of 2. For example, . \fB10mB\fR means blocks of
2095 \fB10000000\fR bytes while \fB10m\fR means blocks of \fB10*2^20 -- 10485760
2096 --\fR bytes. This is mutually exclusive with the \fB-h\fR option.
2097 .RE
2098 
2099 .sp
2100 .ne 2
2101 .na
2102 \fB\fB--color\fR \fB[=\fR\fIwhen\fR\fB]\fR\fR
2103 .ad
2104 .br
2105 .na
2106 \fB\fB--colour\fR\fB[=\fR\fIwhen\fR\fB]\fR\fR
2107 .ad
2108 .sp .6
2109 .RS 4n
2110 Display filenames using color on color-capable terminals. \fIwhen\fR is an
2111 optional argument that determines when to display color output.
2112 .sp
2113 Possible values for \fIwhen\fR are:
2114 .sp
2115 .ne 2
2116 .na
2117 \fB\fBalways\fR\fR
2118 .ad
2119 .br
2120 .na
2121 \fB\fByes\fR\fR
2122 .ad
2123 .br
2124 .na
2125 \fB\fBforce\fR\fR
2126 .ad
2127 .sp .6
2128 .RS 4n
2129 Always use color.
2130 .RE
2131 
2132 .sp
2133 .ne 2
2134 .na
2135 \fB\fBauto\fR\fR
2136 .ad
2137 .br
2138 .na
2139 \fB\fBtty\fR\fR
2140 .ad
2141 .br
2142 .na
2143 \fB\fBif-tty\fR\fR
2144 .ad
2145 .sp .6
2146 .RS 4n
2147 Use color if a terminal is present.
2148 .RE
2149 
2150 .sp
2151 .ne 2
2152 .na
2153 \fB\fBno\fR\fR
2154 .ad
2155 .br
2156 .na
2157 \fB\fBnever\fR\fR
2158 .ad
2159 .br
2160 .na
2161 \fB\fBnone\fR\fR
2162 .ad
2163 .sp .6
2164 .RS 4n
2165 Never use color. This is the default
2166 .RE
2167 
2168 See \fBCOLOR OUTPUT\fR for information on how to control the output colors.
2169 .RE
2170 
2171 .sp
2172 .ne 2
2173 .na
2174 \fB\fB--file-type\fR\fR
2175 .ad
2176 .sp .6
2177 .RS 4n
2178 Display a suffix after a file depending on it's type, similar to the \fB-F\fR
2179 option, except \fB*\fR is not appended to executable files.
2180 .RE
2181 
2182 .sp
2183 .ne 2
2184 .na
2185 \fB\fB-si\fR\fR
2186 .ad
2187 .br
2188 .na
2189 \fB\fB--\fR\fR
2190 .ad
2191 .sp .6
2192 .RS 4n
2193 Display human scaled sizes similar to the \fB-h\fR option, except values are
2194 repeatedly divided by 1000 instead of 1024. The last option \fB--si\fR or
2195 \fB-h\fR determines the divisor used.
2196 .RE
2197 
2198 .sp
2199 .ne 2
2200 .na
2201 \fB\fB--time-style\fR style\fR
2202 .ad
2203 .sp .6
2204 .RS 4n
2205 Display times using the specified style. This does not effect the times
2206 displayed for extended attributes (\fB-%\fR).
2207 .sp
2208 Possible values for \fIstyle\fR are:
2209 .sp
2210 .ne 2
2211 .na
2212 \fB\fBfull-iso\fR\fR
2213 .ad
2214 .sp .6
2215 .RS 4n
2216 Equivalent to \fB-E\fR.
2217 .RE
2218 
2219 .sp
2220 .ne 2
2221 .na
2222 \fB\fBlong-iso\fR\fR
2223 .ad
2224 .sp .6
2225 .RS 4n
2226 Display in \fIYYYY-MM-DD HH:MM\fR for all files.
2227 .RE
2228 
2229 .sp
2230 .ne 2
2231 .na
2232 \fB\fBiso\fR\fR
2233 .ad
2234 .sp .6
2235 .RS 4n
2236 Display older files using \fIYYYY-MM-DD\fR and newer files with \fIMM-DD
2237 HH:MM\fR.
2238 .RE
2239 
2240 .sp
2241 .ne 2
2242 .na
2243 \fB\fBlocale\fR\fR
2244 .ad
2245 .sp .6
2246 .RS 4n
2247 Use the default locale format for old and new files. This is the default.
2248 .RE
2249 
2250 .sp
2251 .ne 2
2252 .na
2253 \fB\fB+FORMAT\fR\fR
2254 .ad
2255 .sp .6
2256 .RS 4n
2257 Use a custom format. Values are the same as described in \fBstrftime\fR(3C). If
2258 a NEWLINE appears in the string, the first line is used for older files and the
2259 second line is used for newer files. Otherwise, the given format is used for
2260 all files.
2261 .RE
2262 
2263 .RE
2264 
2265 .SS "/usr/bin/ls"
2266 .ne 2
2267 .na
2268 \fB\fB-F\fR\fR
2269 .ad
2270 .sp .6
2271 .RS 4n
2272 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2273 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2274 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2275 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2276 with a trailing equals sign (\fB=\fR). Follows \fBsymlinks\fR named as
2277 operands.
2278 .RE
2279 
2280 .sp
2281 .ne 2
2282 .na
2283 \fB\fB--file-type\fR\fR
2284 .ad
2285 .sp .6
2286 .RS 4n
2287 Marks entries as with \fB-F\fR with the exception of executable files.
2288 Executable files are not marked. Follows symlinks named as operands.
2289 .RE
2290 
2291 .sp
2292 .LP
2293 Specifying more than one of the options in the following mutually exclusive
2294 pairs is not considered an error: \fB-C\fR and \fB-l\fR (ell), \fB-m\fR and
2295 \fB-l\fR (ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR (ell). The
2296 \fB-l\fR option overrides the other option specified in each pair.
2297 .sp
2298 .LP
2299 Specifying more than one of the options in the following mutually exclusive
2300 groups is not considered an error: \fB-C\fR and \fB-1\fR (one), \fB-H\fR and
2301 \fB-L\fR, \fB-c\fR and \fB-u\fR, and \fB-e\fR and \fB-E\fR, and \fB-t\fR and
2302 \fB-S\fR. The last option specifying a specific timestamp (\fB-c\fR, \fB-u\fR,
2303 \fB-% atime\fR , \fB-% crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR)
2304 determines the timestamps used for sorting or in long format listings. The last
2305 option \fB-t\fR, \fB-S\fR, or \fB-U\fR determines the sorting behavior.
2306 .SS "/usr/xpg4/bin/ls"
2307 .ne 2
2308 .na
2309 \fB\fB-F\fR\fR
2310 .ad
2311 .sp .6
2312 .RS 4n
2313 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2314 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2315 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2316 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2317 with a trailing equals sign (\fB=\fR). Follows symlinks named as operands.
2318 .RE
2319 
2320 .sp
2321 .ne 2
2322 .na
2323 \fB\fB--file-type\fR\fR
2324 .ad
2325 .sp .6
2326 .RS 4n
2327 Marks entries as with \fB-F\fR with the exception of executable files.
2328 Executable files are not marked. Follows symlinks named as operands.
2329 .RE
2330 
2331 .sp
2332 .LP
2333 Specifying more than one of the options in the following groups of mutually
2334 exclusive options is not considered an error: \fB-C\fR and \fB-l\fR (ell),
2335 \fB-m\fR and \fB-l\fR (ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR
2336 (ell), \fB-C\fR and \fB-1\fR (one), \fB-H\fR and \fB-L\fR, \fB-c\fR and
2337 \fB-u\fR, \fB-e\fR and \fB-E\fR, \fB-t\fR and \fB-S\fR and \fB-U\fR. The last
2338 option specifying a specific timestamp (\fB-c\fR, \fB-u\fR, \fB-% atime\fR ,
2339 \fB-% crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR) determines the timestamps
2340 used for sorting or in long format listings. The last \fB-t\fR, \fB-S\fR, or
2341 \fB-U\fR option determines the sorting behavior.
2342 .SS "/usr/xpg6/bin/ls"
2343 .ne 2
2344 .na
2345 \fB\fB-F\fR\fR
2346 .ad
2347 .sp .6
2348 .RS 4n
2349 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2350 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2351 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2352 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2353 with a trailing equals sign (\fB=\fR). Does not follow symlinks named as
2354 operands unless the \fB-H\fR or \fB-L\fR option is specified.
2355 .RE
2356 
2357 .sp
2358 .ne 2
2359 .na
2360 \fB\fB--file-type\fR\fR
2361 .ad
2362 .sp .6
2363 .RS 4n
2364 Marks entries as with \fB-F\fR with the exception of executable files.
2365 Executable files are not marked. Does not follow symlinks named as operands
2366 unless the \fB-H\fR or \fB-L\fR option is specified.
2367 .RE
2368 
2369 .sp
2370 .LP
2371 Specifying more than one of the options in the following mutually exclusive
2372 pairs is not considered an error: \fB-C\fR and \fB-l\fR (ell), m and
2373 \fB-l\fR(ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR (ell),
2374 \fB-C\fR and \fB-1\fR (one), \fB-H\fR and -\fB-L\fR, \fB-c\fR and \fB-u\fR,
2375 \fB-e\fR and \fB-E\fR, \fB-t\fR and \fB-S\fR and \fB-U\fR. The last option
2376 specifying a specific timestamp (\fB-c\fR, \fB-u\fR, \fB-% atime\fR , \fB-%
2377 crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR) determines the timestamps used
2378 for sorting or in long format listings. The last \fB-t\fR, \fB-S\fR, or
2379 \fB-U\fR option determines the sorting behavior.
2380 .SH OPERANDS
2381 .LP
2382 The following operand is supported:
2383 .sp
2384 .ne 2
2385 .na
2386 \fB\fIfile\fR\fR
2387 .ad
2388 .sp .6
2389 .RS 4n
2390 A path name of a file to be written. If the file specified is not found, a
2391 diagnostic message is output on standard error.
2392 .RE
2393 
2394 .SH USAGE
2395 .LP
2396 See \fBlargefile\fR(5) for the description of the behavior of \fBls\fR when
2397 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
2398 .SH EXAMPLES
2399 .LP
2400 \fBExample 1 \fRViewing File Permissions
2401 .sp
2402 .LP
2403 The following example shows how to display detailed information about a file.
2404 
2405 .sp
2406 .in +2
2407 .nf
2408 % ls -l file.1
2409 -rw-r--r--   1 gozer    staff     206663 Mar 14 10:15 file.1
2410 .fi
2411 .in -2
2412 .sp
2413 
2414 .sp
2415 .LP
2416 The permissions string above (\fB-rw-r--r--\fR) describes that the file owner
2417 has read and write permissions, the owning group has read permissions, and
2418 others have read permissions.
2419 
2420 .sp
2421 .LP
2422 The following example shows how to display detailed information about a
2423 directory.
2424 
2425 .sp
2426 .in +2
2427 .nf
2428 % ls -ld test.dir
2429 drwxr-xr-x   2 gozer    staff          2 Mar 14 10:17 test.dir
2430 .fi
2431 .in -2
2432 .sp
2433 
2434 .sp
2435 .LP
2436 The permissions string above (\fBdrwxr-xr-x\fR) describes that the directory
2437 owner has read, write, and search permissions, the owning group has read and
2438 search permissions, and others have read and search permissions.
2439 
2440 .sp
2441 .LP
2442 Another example of listing file permissions is as follows:
2443 
2444 .sp
2445 .in +2
2446 .nf
2447 % ls -l file.2
2448 -rw-rwl---   1 gozer    staff     206663 Mar 14 10:47 file.2
2449 .fi
2450 .in -2
2451 .sp
2452 
2453 .sp
2454 .LP
2455 The permissions string above (\fB-rw-rwl---\fR) describes that the file owner
2456 has read and write permissions, the owning group has read and write
2457 permissions, and the file can be locked during access.
2458 
2459 .LP
2460 \fBExample 2 \fRDisplaying ACL Information on Files and Directories
2461 .sp
2462 .LP
2463 The following example shows how to display verbose ACL information on a ZFS
2464 file.
2465 
2466 .sp
2467 .in +2
2468 .nf
2469 % ls -v file.1
2470 -rw-r--r--   1 marks    staff     206663 Mar 14 10:15 file.1
2471      0:owner@:execute:deny
2472      1:owner@:read_data/write_data/append_data/write_xattr/write_attributes
2473           /write_acl/write_owner:allow
2474      2:group@:write_data/append_data/execute:deny
2475      3:group@:read_data:allow
2476      4:everyone@:write_data/append_data/write_xattr/execute/write_attributes
2477           /write_acl/write_owner:deny
2478      5:everyone@:read_data/read_xattr/read_attributes/read_acl/synchronize
2479           :allow
2480 .fi
2481 .in -2
2482 .sp
2483 
2484 .sp
2485 .LP
2486 The following example shows how to display compact ACL information on a ZFS
2487 directory.
2488 
2489 .sp
2490 .in +2
2491 .nf
2492 % ls -dV test.dir
2493 drwxr-xr-x   2 marks    staff          2 Mar 14 10:17 test.dir
2494             owner@:--------------:------:deny
2495             owner@:rwxp---A-W-Co-:------:allow
2496             group@:-w-p----------:------:deny
2497             group@:r-x-----------:------:allow
2498             everyone@:-w-p---A-W-Co-:------:deny
2499             everyone@:r-x---a-R-c--s:------:allow
2500 .fi
2501 .in -2
2502 .sp
2503 
2504 .sp
2505 .LP
2506 The following example illustrates the \fBls\fR \fB-v\fR behavior when listing
2507 ACL  information on a UFS file.
2508 
2509 .sp
2510 .in +2
2511 .nf
2512 $ ls -v file.3
2513 -rw-r--r--   1 root     root        2703 Mar 14 10:59 file.3
2514      0:user::rw-
2515      1:group::r--               #effective:r--
2516      2:mask:r--
2517      3:other:r--
2518 .fi
2519 .in -2
2520 .sp
2521 
2522 .LP
2523 \fBExample 3 \fRPrinting the Names of All Files
2524 .sp
2525 .LP
2526 The following example prints the names of all files in the current directory,
2527 including those that begin with a dot (\fB\&.\fR), which normally do not print:
2528 
2529 .sp
2530 .in +2
2531 .nf
2532 example% \fBls -a\fR
2533 .fi
2534 .in -2
2535 .sp
2536 
2537 .LP
2538 \fBExample 4 \fRProviding File Information
2539 .sp
2540 .LP
2541 The following example provides file information:
2542 
2543 .sp
2544 .in +2
2545 .nf
2546 example% ls -aisn
2547 .fi
2548 .in -2
2549 .sp
2550 
2551 .sp
2552 .LP
2553 This command provides information on \fBa\fRll files, including those that
2554 begin with a dot (\fBa\fR), the \fBi\fR-number, the memory address of the
2555 i-node associated with the file\(emprinted in the left-hand column (\fBi\fR);
2556 the \fBs\fRize (in blocks) of the files, printed in the column to the right of
2557 the i-numbers (\fBs\fR); finally, the report is displayed in the \fBn\fRumeric
2558 version of the long list, printing the \fBUID\fR (instead of user name) and
2559 \fBGID\fR (instead of group name) numbers associated with the files.
2560 
2561 .sp
2562 .LP
2563 When the sizes of the files in a directory are listed, a total count of blocks,
2564 including indirect blocks, is printed.
2565 
2566 .LP
2567 \fBExample 5 \fRProviding Extended System Attributes Information
2568 .sp
2569 .in +2
2570 .nf
2571 example% ls -/ c file    (extended system attribute in compact mode)
2572 -rw-r--r--   1 root     root           0 May 10 14:17 file
2573                          {AHRSadim-u--}
2574 .fi
2575 .in -2
2576 .sp
2577 
2578 .sp
2579 .LP
2580 In this example, \fBav_quarantined\fR, \fBoffline\fR, and \fBsparse\fR
2581 are not set.
2582 .sp
2583 .in +2
2584 .nf
2585 example% ls -/ v file (extended system attribute in verbose mode)
2586 -rw-r--r--   1 root     root           0 May 10 14:17 file
2587                 {archive,hidden,readonly,system,\e
2588                  appendonly,nodump,immutable,av_modified,\e
2589                  noav_quarantined,nounlink,nooffline,\e
2590                  nosparse}
2591 
2592 example% ls -/ v file     (no extended system attribute)
2593 -rw-r--r--  1 root    staff        0 May 16 14:48 file
2594                {}
2595 
2596 example% ls -/ c file        (extended system attribute
2597                               supported file system)
2598 
2599 -rw-r--r--  1 root staff        3 Jun  4 22:04 file
2600                {A------m----}
2601 .fi
2602 .in -2
2603 .sp
2604 
2605 .sp
2606 .LP
2607 \fBarchive\fR and \fBav_modified\fR attributes are set by default on  an
2608 extended system attribute supported file.
2609 .sp
2610 .in +2
2611 .nf
2612 example% ls -/ c  -%crtime file
2613 
2614 -rw-r--r--    root     root          0 May 10 14:17 file
2615                {AHRSadim-u--}
2616 .fi
2617 .in -2
2618 .sp
2619 
2620 .sp
2621 .LP
2622 This example displays the timestamp as the creation time:
2623 .sp
2624 .in +2
2625 .nf
2626 example% ls -l -%all file
2627 -rw-r--r--   1 root     root           0 May 10 14:17    file
2628                 timestamp: atime    Jun 14 08:47:37 2007
2629                 timestamp: ctime    May 10 14:20:23 2007
2630                 timestamp: mtime    May 10 14:17:56 2007
2631                 timestamp: crtime   May 10 14:17:56 2007
2632 
2633 example% ls -%crtime -tl file*
2634 
2635 -rw-r--r--   1 foo      staff          3 Jun  4 22:04 file1
2636 -rw-r--r--   1 root     root           0 May 10 14:17 file
2637 -rw-r--r--   1 foo      staff          0 May  9 13:49 file.1
2638 .fi
2639 .in -2
2640 .sp
2641 
2642 .sp
2643 .LP
2644 In this example the files are sorted by creation time.
2645 .SH ENVIRONMENT VARIABLES
2646 .LP
2647 See \fBenviron\fR(5) for descriptions of the following environment variables
2648 that affect the execution of \fBls\fR: \fBLANG\fR, \fBLC_ALL\fR,
2649 \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_TIME\fR, \fBLC_MESSAGES\fR,
2650 \fBNLSPATH\fR, and \fBTZ\fR.
2651 .sp
2652 .ne 2
2653 .na
2654 \fB\fBCOLUMNS\fR\fR
2655 .ad
2656 .sp .6
2657 .RS 4n
2658 Determines the user's preferred column position width for writing multiple
2659 text-column output. If this variable contains a string representing a decimal
2660 integer, the \fBls\fR utility calculates how many path name text columns to
2661 write (see \fB-C\fR) based on the width provided. If \fBCOLUMNS\fR is not set
2662 or is invalid, 80 is used. The column width chosen to write the names of files
2663 in any given directory is constant. File names are not be truncated to fit into
2664 the multiple text-column output.
2665 .RE
2666 
2667 .sp
2668 .ne 2
2669 .na
2670 \fB\fBLS_COLORS\fR\fR
2671 .ad
2672 .sp .6
2673 .RS 4n
2674 Determines the coloring scheme used when displaying color output. If not set
2675 and color output is specified, a default scheme is used. If TERM is not set, no
2676 color output is used.
2677 .RE
2678 
2679 .sp
2680 .ne 2
2681 .na
2682 \fB\fBTERM\fR\fR
2683 .ad
2684 .sp .6
2685 .RS 4n
2686 Determine the terminal type. If this variable is unset or NULL, no color output
2687 is generated regardless of the value of the --color option.
2688 .RE
2689 
2690 .SH EXIT STATUS
2691 .ne 2
2692 .na
2693 \fB\fB0\fR\fR
2694 .ad
2695 .RS 6n
2696 All information was written successfully.
2697 .RE
2698 
2699 .sp
2700 .ne 2
2701 .na
2702 \fB\fB>0\fR\fR
2703 .ad
2704 .RS 6n
2705 An error occurred.
2706 .RE
2707 
2708 .SH FILES
2709 .ne 2
2710 .na
2711 \fB\fB/etc/group\fR\fR
2712 .ad
2713 .sp .6
2714 .RS 4n
2715 group IDs for \fBls\fR \fB-l\fR and \fBls\fR \fB-g\fR
2716 .RE
2717 
2718 .sp
2719 .ne 2
2720 .na
2721 \fB\fB/etc/passwd\fR\fR
2722 .ad
2723 .sp .6
2724 .RS 4n
2725 user IDs for \fBls\fR \fB-l\fR and \fBls\fR \fB-o\fR
2726 .RE
2727 
2728 .sp
2729 .ne 2
2730 .na
2731 \fB\fB/usr/share/lib/terminfo/?/*\fR\fR
2732 .ad
2733 .sp .6
2734 .RS 4n
2735 terminal information database
2736 .RE
2737 
2738 .SH ATTRIBUTES
2739 .LP
2740 See \fBattributes\fR(5) for descriptions of the following attributes:
2741 .SS "/usr/bin/ls"
2742 
2743 .TS
2744 box;
2745 c | c
2746 l | l .
2747 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2748 _
2749 CSI     Enabled
2750 _
2751 Interface Stability     Committed
2752 _
2753 Standard        See below.
2754 .TE
2755 
2756 .sp
2757 .LP
2758 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2759 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2760 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2761 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2762 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2763 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2764 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2765 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2766 .SS "/usr/xpg4/bin/ls"
2767 
2768 .TS
2769 box;
2770 c | c
2771 l | l .
2772 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2773 _
2774 CSI     Enabled
2775 _
2776 Interface Stability     Committed
2777 _
2778 Standard        See below.
2779 .TE
2780 
2781 .sp
2782 .LP
2783 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2784 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2785 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2786 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2787 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2788 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2789 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2790 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2791 .SS "/usr/xpg6/bin/ls"
2792 
2793 .TS
2794 box;
2795 c | c
2796 l | l .
2797 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2798 _
2799 CSI     Enabled
2800 _
2801 Interface Stability     Committed
2802 _
2803 Standard        See below.
2804 .TE
2805 
2806 .sp
2807 .LP
2808 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2809 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2810 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2811 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2812 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2813 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2814 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2815 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2816 .SH SEE ALSO
2817 .LP
2818 \fBchmod\fR(1), \fBcp\fR(1), \fBsetfacl\fR(1), \fBfgetattr\fR(3C),
2819 \fBstrftime\fR(3C), \fBterminfo\fR(4), \fBacl\fR(5), \fBattributes\fR(5),
2820 \fBenviron\fR(5), \fBfsattr\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
2821 .SH NOTES
2822 .LP
2823 Unprintable characters in file names can confuse the columnar output options.
2824 .sp
2825 .LP
2826 The total block count is incorrect if there are hard links among the files.
2827 .sp
2828 .LP
2829 The sort order of \fBls\fR output is affected by the locale and can be
2830 overridden by the \fBLC_COLLATE\fR environment variable. For example, if
2831 \fBLC_COLLATE\fR equals \fBC\fR, dot files appear first, followed by names
2832 beginning with upper-case letters, then followed by names beginning with
2833 lower-case letters. But if \fBLC_COLLATE\fR equals \fBen_US.ISO8859-1\fR, then
2834 leading dots as well as case are ignored in determining the sort order.