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 2016 Nexenta Systems, Inc.  All Rights Reserved.
  47 .\"
  48 .TH LS 1 "Jul 01, 2016"
  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. Files for
1192 which owner and/or group is a Windows Security Identifier (\fBSID\fR), \fB-n\fR
1193 suppresses any lookups for the Windows Name string and prints only the raw SID.
1194 Moreover, a second instance of this flag (\fB-nn\fR) can be used to further
1195 suppress \fBidmapd\fR(1M) lookups of the file's owner and/or group SID, thus
1196 forcing \fBls\fR into printing the raw ephemeral numeric identifiers.
1197 .RE
1198 
1199 .sp
1200 .ne 2
1201 .na
1202 \fB\fB-o\fR\fR
1203 .ad
1204 .br
1205 .na
1206 \fB\fB--no-group\fR\fR
1207 .ad
1208 .sp .6
1209 .RS 4n
1210 The same as \fB-l\fR, except that the group is not printed.
1211 .RE
1212 
1213 .sp
1214 .ne 2
1215 .na
1216 \fB\fB-p\fR\fR
1217 .ad
1218 .sp .6
1219 .RS 4n
1220 Puts a slash (\fB/\fR) after each filename if the file is a directory.
1221 .RE
1222 
1223 .sp
1224 .ne 2
1225 .na
1226 \fB\fB-q\fR\fR
1227 .ad
1228 .br
1229 .na
1230 \fB\fB--hide-control-chars\fR\fR
1231 .ad
1232 .sp .6
1233 .RS 4n
1234 Forces printing of non-printable characters in file names as the character
1235 question mark (\fB?\fR).
1236 .RE
1237 
1238 .sp
1239 .ne 2
1240 .na
1241 \fB\fB-r\fR\fR
1242 .ad
1243 .br
1244 .na
1245 \fB\fB--reverse\fR\fR
1246 .ad
1247 .sp .6
1248 .RS 4n
1249 Reverses the order of sort to get reverse alphabetic, oldest first, or smallest
1250 file size first as appropriate.
1251 .RE
1252 
1253 .sp
1254 .ne 2
1255 .na
1256 \fB\fB-R\fR\fR
1257 .ad
1258 .br
1259 .na
1260 \fB\fB--recursive\fR\fR
1261 .ad
1262 .sp .6
1263 .RS 4n
1264 Recursively lists subdirectories encountered.
1265 .RE
1266 
1267 .sp
1268 .ne 2
1269 .na
1270 \fB\fB-s\fR\fR
1271 .ad
1272 .br
1273 .na
1274 \fB\fB--size\fR\fR
1275 .ad
1276 .sp .6
1277 .RS 4n
1278 Indicate the total number of file system blocks consumed by each file
1279 displayed.
1280 .RE
1281 
1282 .sp
1283 .ne 2
1284 .na
1285 \fB\fB-S\fR\fR
1286 .ad
1287 .sp .6
1288 .RS 4n
1289 Sort by file size (in decreasing order) and for files with the same size by
1290 file name (in increasing alphabetic order) instead of just by name.
1291 .RE
1292 
1293 .sp
1294 .ne 2
1295 .na
1296 \fB\fB-t\fR\fR
1297 .ad
1298 .sp .6
1299 .RS 4n
1300 Sorts by time stamp (latest first) instead of by name. The default is the last
1301 modification time. See \fB-c\fR, \fB-u\fR and \fB-%\fR.
1302 .RE
1303 
1304 .sp
1305 .ne 2
1306 .na
1307 \fB\fB-u\fR\fR
1308 .ad
1309 .sp .6
1310 .RS 4n
1311 Uses time of last access instead of last modification for sorting (with the
1312 \fB-t\fR option) or printing (with the \fB-l\fR option).
1313 .RE
1314 
1315 .sp
1316 .ne 2
1317 .na
1318 \fB\fB-U\fR\fR
1319 .ad
1320 .sp .6
1321 .RS 4n
1322 Output is unsorted.
1323 .RE
1324 
1325 .sp
1326 .ne 2
1327 .na
1328 \fB\fB-v\fR\fR
1329 .ad
1330 .sp .6
1331 .RS 4n
1332 The same as \fB-l\fR, except that verbose ACL information is displayed as well
1333 as the \fB-l\fR output. ACL information is displayed even if the file or
1334 directory doesn't have an ACL.
1335 .RE
1336 
1337 .sp
1338 .ne 2
1339 .na
1340 \fB\fB-V\fR\fR
1341 .ad
1342 .sp .6
1343 .RS 4n
1344 The same as \fB-l\fR, except that compact ACL information is displayed after
1345 the \fB-l\fR output.
1346 .sp
1347 The \fB-V\fR option is only applicable to file systems that support NFSv4 ACLs,
1348 such as the Solaris ZFS file system.
1349 .sp
1350 The format of the displayed ACL is as follows:
1351 .sp
1352 .in +2
1353 .nf
1354 \fIentry_type\fR : \fIpermissions\fR : \fIinheritance_flags\fR : \fIaccess_type\fR
1355 .fi
1356 .in -2
1357 .sp
1358 
1359 \fIentry_type\fR is displayed as one of the following:
1360 .sp
1361 .ne 2
1362 .na
1363 \fBuser:\fIusername\fR\fR
1364 .ad
1365 .sp .6
1366 .RS 4n
1367 Additional user access for \fIusername\fR.
1368 .RE
1369 
1370 .sp
1371 .ne 2
1372 .na
1373 \fBgroup:\fIgroupname\fR\fR
1374 .ad
1375 .sp .6
1376 .RS 4n
1377 Additional group access for group \fIgroupname\fR.
1378 .RE
1379 
1380 .sp
1381 .ne 2
1382 .na
1383 \fBowner@\fR
1384 .ad
1385 .sp .6
1386 .RS 4n
1387 File owner.
1388 .RE
1389 
1390 .sp
1391 .ne 2
1392 .na
1393 \fBgroup@\fR
1394 .ad
1395 .sp .6
1396 .RS 4n
1397 File group owner.
1398 .RE
1399 
1400 .sp
1401 .ne 2
1402 .na
1403 \fBeveryone@\fR
1404 .ad
1405 .sp .6
1406 .RS 4n
1407 Everyone access, including file owner and file group owner. This is not
1408 equivalent to the POSIX other class.
1409 .RE
1410 
1411 The following permissions, supported by the NFSv4 ACL model, are displayed by
1412 using the \fB-v\fR or \fB-V\fR options:
1413 .sp
1414 .ne 2
1415 .na
1416 \fBread_data (\fBr\fR)\fR
1417 .ad
1418 .sp .6
1419 .RS 4n
1420 Permission to read the data of a file.
1421 .RE
1422 
1423 .sp
1424 .ne 2
1425 .na
1426 \fBlist_directory (\fBr\fR)\fR
1427 .ad
1428 .sp .6
1429 .RS 4n
1430 Permission to list the contents of a directory.
1431 .RE
1432 
1433 .sp
1434 .ne 2
1435 .na
1436 \fBwrite_data (\fBw\fR)\fR
1437 .ad
1438 .sp .6
1439 .RS 4n
1440 Permission to modify a file's data. anywhere in the file's offset range.
1441 .RE
1442 
1443 .sp
1444 .ne 2
1445 .na
1446 \fBadd_file (\fBw\fR)\fR
1447 .ad
1448 .sp .6
1449 .RS 4n
1450 Permission to add a new file to a directory.
1451 .RE
1452 
1453 .sp
1454 .ne 2
1455 .na
1456 \fBappend_data (\fBp\fR)\fR
1457 .ad
1458 .sp .6
1459 .RS 4n
1460 The ability to modify a file's data, but only starting at EOF.
1461 .RE
1462 
1463 .sp
1464 .ne 2
1465 .na
1466 \fBadd_subdirectory (\fBp\fR)\fR
1467 .ad
1468 .sp .6
1469 .RS 4n
1470 Permission to create a subdirectory to a directory.
1471 .RE
1472 
1473 .sp
1474 .ne 2
1475 .na
1476 \fBread_xattr (\fBR\fR)\fR
1477 .ad
1478 .sp .6
1479 .RS 4n
1480 Ability to read the extended attributes of a file.
1481 .RE
1482 
1483 .sp
1484 .ne 2
1485 .na
1486 \fBwrite_xattr (\fBW\fR)\fR
1487 .ad
1488 .sp .6
1489 .RS 4n
1490 Ability to create extended attributes or write to the extended attribute
1491 directory.
1492 .RE
1493 
1494 .sp
1495 .ne 2
1496 .na
1497 \fBexecute (\fBx\fR)\fR
1498 .ad
1499 .sp .6
1500 .RS 4n
1501 Permission to execute a file.
1502 .RE
1503 
1504 .sp
1505 .ne 2
1506 .na
1507 \fBread_attributes (\fBa\fR)\fR
1508 .ad
1509 .sp .6
1510 .RS 4n
1511 The ability to read basic attributes (non-ACLs) of a file.
1512 .RE
1513 
1514 .sp
1515 .ne 2
1516 .na
1517 \fBwrite_attributes (\fBA\fR)\fR
1518 .ad
1519 .sp .6
1520 .RS 4n
1521 Permission to change the times associated with a file or directory to an
1522 arbitrary value.
1523 .RE
1524 
1525 .sp
1526 .ne 2
1527 .na
1528 \fBdelete (\fBd\fR)\fR
1529 .ad
1530 .sp .6
1531 .RS 4n
1532 Permission to delete a file.
1533 .RE
1534 
1535 .sp
1536 .ne 2
1537 .na
1538 \fBdelete_child (\fBD\fR)\fR
1539 .ad
1540 .sp .6
1541 .RS 4n
1542 Permission to delete a file within a directory.
1543 .RE
1544 
1545 .sp
1546 .ne 2
1547 .na
1548 \fBread_acl (\fBc\fR)\fR
1549 .ad
1550 .sp .6
1551 .RS 4n
1552 Permission to read the ACL of a file.
1553 .RE
1554 
1555 .sp
1556 .ne 2
1557 .na
1558 \fBwrite_acl (\fBC\fR)\fR
1559 .ad
1560 .sp .6
1561 .RS 4n
1562 Permission to write the ACL of a file.
1563 .RE
1564 
1565 .sp
1566 .ne 2
1567 .na
1568 \fBwrite_owner (\fBo\fR)\fR
1569 .ad
1570 .sp .6
1571 .RS 4n
1572 Permission to change the owner of a file.
1573 .RE
1574 
1575 .sp
1576 .ne 2
1577 .na
1578 \fBsynchronize (\fBs\fR)\fR
1579 .ad
1580 .sp .6
1581 .RS 4n
1582 Permission to access file locally at server with synchronize reads and writes.
1583 .RE
1584 
1585 .sp
1586 .ne 2
1587 .na
1588 \fB\fB-\fR\fR
1589 .ad
1590 .sp .6
1591 .RS 4n
1592 No permission granted
1593 .RE
1594 
1595 The following inheritance flags, supported by the NFSv4 ACL model, are
1596 displayed by using the \fB-v\fR or \fB-V\fR options:
1597 .sp
1598 .ne 2
1599 .na
1600 \fBfile_inherit (\fBf\fR)\fR
1601 .ad
1602 .sp .6
1603 .RS 4n
1604 Inherit to all newly created files.
1605 .RE
1606 
1607 .sp
1608 .ne 2
1609 .na
1610 \fBdir_inherit (\fBd\fR)\fR
1611 .ad
1612 .sp .6
1613 .RS 4n
1614 Inherit to all newly created directories.
1615 .RE
1616 
1617 .sp
1618 .ne 2
1619 .na
1620 \fBinherit_only (\fBi\fR)\fR
1621 .ad
1622 .sp .6
1623 .RS 4n
1624 When placed on a directory, do not apply to the directory, only to newly
1625 created files and directories. This flag requires that either
1626 \fBfile_inherit\fR and or \fBdir_inherit\fR is also specified.
1627 .RE
1628 
1629 .sp
1630 .ne 2
1631 .na
1632 \fBno_propagate (\fBn\fR)\fR
1633 .ad
1634 .sp .6
1635 .RS 4n
1636 Indicates that ACL entries should be inherited to objects in a directory, but
1637 inheritance should stop after descending one level. This flag is dependent upon
1638 either \fBfile_inherit\fR and or \fBdir_inherit\fR also being specified.
1639 .RE
1640 
1641 .sp
1642 .ne 2
1643 .na
1644 \fBsuccessful_access (\fBS\fR)\fR
1645 .ad
1646 .sp .6
1647 .RS 4n
1648 Indicates whether an alarm or audit record should be initiated upon successful
1649 accesses. Used with audit/alarm ACE types.
1650 .RE
1651 
1652 .sp
1653 .ne 2
1654 .na
1655 \fBfailed_access (\fBF\fR)\fR
1656 .ad
1657 .sp .6
1658 .RS 4n
1659 Indicates whether an alarm or audit record should be initiated when access
1660 fails. Used with audit/alarm ACE types.
1661 .RE
1662 
1663 .sp
1664 .ne 2
1665 .na
1666 \fBinherited (\fBI\fR)\fR
1667 .ad
1668 .sp .6
1669 .RS 4n
1670 ACE was inherited.
1671 .RE
1672 
1673 .sp
1674 .ne 2
1675 .na
1676 \fB\fB-\fR\fR
1677 .ad
1678 .sp .6
1679 .RS 4n
1680 No permission granted.
1681 .RE
1682 
1683 \fIaccess_type\fR is displayed as one of the following types:
1684 .sp
1685 .ne 2
1686 .na
1687 \fBalarm\fR
1688 .ad
1689 .RS 9n
1690 Permission field that specifies permissions that should trigger an alarm.
1691 .RE
1692 
1693 .sp
1694 .ne 2
1695 .na
1696 \fBallow\fR
1697 .ad
1698 .RS 9n
1699 Permission field that specifies allow permissions.
1700 .RE
1701 
1702 .sp
1703 .ne 2
1704 .na
1705 \fBaudit\fR
1706 .ad
1707 .RS 9n
1708 Permission field that specifies permissions that should be audited.
1709 .RE
1710 
1711 .sp
1712 .ne 2
1713 .na
1714 \fBdeny\fR
1715 .ad
1716 .RS 9n
1717 Permission field that specifies deny permissions.
1718 .RE
1719 
1720 For example:
1721 .sp
1722 .in +2
1723 .nf
1724 $ ls -dV /sandbox/dir.1
1725   drwxr-xr-x+  2 root     root           2 Jan 17 15:09 dir.1
1726                   user:marks:r-------------:fd-----:allow
1727                       owner@:--------------:-------:deny
1728                       owner@:rwxp---A-W-Co-:-------:allow
1729                       group@:-w-p----------:-------:deny
1730                       group@:r-x-----------:-------:allow
1731                    everyone@:-w-p---A-W-Co-:-------:deny
1732                    everyone@:r-x---a-R-c--s:-------:allow
1733 $
1734                            ||||||||||||||||:||||||+ inherited access
1735                              ||||||||||||||:||||||+ failed access
1736                              ||||||||||||||:|||||+--success access
1737                              ||||||||||||||:||||+-- no propagate
1738                              ||||||||||||||:|||+--- inherit only
1739                              ||||||||||||||:||+---- directory inherit
1740                              ||||||||||||||:|+----- file inherit
1741                              ||||||||||||||
1742                              ||||||||||||||+ sync
1743                              |||||||||||||+- change owner
1744                              ||||||||||||+-- write ACL
1745                              |||||||||||+--- read ACL
1746                              ||||||||||+---- write extended attributes
1747                              |||||||||+----- read extended attributes
1748                              ||||||||+------ write attributes
1749                              |||||||+------- read attributes
1750                              ||||||+-------- delete child
1751                              |||||+--------- delete
1752                              ||||+---------- append
1753                              |||+----------- execute
1754                              ||+------------ write data
1755                              |+------------- read data
1756 .fi
1757 .in -2
1758 .sp
1759 
1760 .RE
1761 
1762 .sp
1763 .ne 2
1764 .na
1765 \fB\fB-w\fR \fIcols\fR\fR
1766 .ad
1767 .br
1768 .na
1769 \fB\fB--width\fR \fIcols\fR\fR
1770 .ad
1771 .sp .6
1772 .RS 4n
1773 Multi-column output where the column width is forced to \fIcols\fR.
1774 .RE
1775 
1776 .sp
1777 .ne 2
1778 .na
1779 \fB\fB-x\fR\fR
1780 .ad
1781 .sp .6
1782 .RS 4n
1783 Multi-column output with entries sorted across rather than down the page.
1784 .RE
1785 
1786 .sp
1787 .ne 2
1788 .na
1789 \fB\fB-1\fR\fR
1790 .ad
1791 .sp .6
1792 .RS 4n
1793 Prints one entry per line of output.
1794 .RE
1795 
1796 .sp
1797 .ne 2
1798 .na
1799 \fB\fB-@\fR\fR
1800 .ad
1801 .sp .6
1802 .RS 4n
1803 The same as \fB-l\fR, except that extended attribute information overrides
1804 \fBACL\fR information. An \fB@\fR is displayed after the file permission bits
1805 for files that have extended attributes.
1806 .RE
1807 
1808 .sp
1809 .ne 2
1810 .na
1811 \fB\fB-/ c\fR | \fBv\fR\fR
1812 .ad
1813 .sp .6
1814 .RS 4n
1815 The same as \fB-l\fR, and in addition displays the extended system attributes
1816 associated with the file when extended system attributes are fully supported by
1817 the underlying file system. The option \fB-/\fR supports two option arguments
1818 \fBc\fR (compact mode) and \fBv\fR (verbose mode).
1819 .sp
1820 .ne 2
1821 .na
1822 \fB\fBappendonly\fR\fR
1823 .ad
1824 .sp .6
1825 .RS 4n
1826 Allows a file to be modified only at offset \fBEOF\fR. Attempts to modify a
1827 file at a location other than \fBEOF\fR fails with \fBEPERM\fR.
1828 .RE
1829 
1830 .sp
1831 .ne 2
1832 .na
1833 \fB\fBarchive\fR\fR
1834 .ad
1835 .sp .6
1836 .RS 4n
1837 Indicates if a file has been modified since it was last backed up. Whenever the
1838 modification time (\fBmtime\fR) of a file is changed the \fBarchive\fR
1839 attribute is set.
1840 .RE
1841 
1842 .sp
1843 .ne 2
1844 .na
1845 \fB\fBav_modified\fR\fR
1846 .ad
1847 .sp .6
1848 .RS 4n
1849 ZFS sets the anti-virus attribute which whenever a file's content or size
1850 changes or when the file is renamed.
1851 .RE
1852 
1853 .sp
1854 .ne 2
1855 .na
1856 \fB\fBav_quarantined\fR\fR
1857 .ad
1858 .sp .6
1859 .RS 4n
1860 Anti-virus software sets to mark a file as quarantined.
1861 .RE
1862 
1863 .sp
1864 .ne 2
1865 .na
1866 \fB\fBcrtime\fR\fR
1867 .ad
1868 .sp .6
1869 .RS 4n
1870 Timestamp when a file is created.
1871 .RE
1872 
1873 .sp
1874 .ne 2
1875 .na
1876 \fB\fBhidden\fR\fR
1877 .ad
1878 .sp .6
1879 .RS 4n
1880 Marks a file as hidden.
1881 .RE
1882 
1883 .sp
1884 .ne 2
1885 .na
1886 \fB\fBimmutable\fR\fR
1887 .ad
1888 .sp .6
1889 .RS 4n
1890 Prevents the content of a file from being modified. Also prevents all metadata
1891 changes, except for access time updates. When placed on a directory, prevents
1892 the deletion and creation of files in the directories. Attempts to modify the
1893 content of a file or directory marked as \fBimmutable\fR fail with \fBEPERM\fR.
1894 Attempts to modify any attributes (with the exception of access time and, with
1895 the proper privileges, the \fBimmutable\fR) of a file marked as \fBimmutable\fR
1896 fails with \fBEPERM\fR.
1897 .RE
1898 
1899 .sp
1900 .ne 2
1901 .na
1902 \fB\fBnodump\fR\fR
1903 .ad
1904 .sp .6
1905 .RS 4n
1906 Solaris systems have no special semantics for this attribute.
1907 .RE
1908 
1909 .sp
1910 .ne 2
1911 .na
1912 \fB\fBnounlink\fR\fR
1913 .ad
1914 .sp .6
1915 .RS 4n
1916 Prevents a file from being deleted. On a directory, the attribute also prevents
1917 any changes to the contents of the directory. That is, no files within the
1918 directory can be removed or renamed. The \fBerrno\fR \fBEPERM\fR is returned
1919 when attempting to unlink or rename files and directories that are marked as
1920 \fBnounlink\fR.
1921 .RE
1922 
1923 .sp
1924 .ne 2
1925 .na
1926 \fB\fBoffline\fR\fR
1927 .ad
1928 .sp .6
1929 .RS 4n
1930 Indicate that a file is offline.  Solaris systems have no special semantics for
1931 this attribute.
1932 .RE
1933 
1934 .sp
1935 .ne 2
1936 .na
1937 \fB\fBreadonly\fR\fR
1938 .ad
1939 .sp .6
1940 .RS 4n
1941 Marks a file as \fBreadonly\fR. Once a file is marked as \fBreadonly\fR the
1942 content data of the file cannot be modified. Other metadata for the file can
1943 still be modified.
1944 .RE
1945 
1946 .sp
1947 .ne 2
1948 .na
1949 \fB\fBsparse\fR\fR
1950 .ad
1951 .sp .6
1952 .RS 4n
1953 Indicate that a file can be interpreted as sparse.  It does not indicate that
1954 the file is actually sparse or not.  The sparse attribute is cleared when the
1955 file is truncated to zero length.  Solaris systems have no other special
1956 semantics for this attribute.
1957 .RE
1958 
1959 .sp
1960 .ne 2
1961 .na
1962 \fB\fBsystem\fR\fR
1963 .ad
1964 .sp .6
1965 .RS 4n
1966 Solaris systems have no special semantics for this attribute.
1967 .RE
1968 
1969 .RE
1970 
1971 .sp
1972 .LP
1973 The display characters used in compact mode (\fB-/ c\fR) are as follows:
1974 .sp
1975 .in +2
1976 .nf
1977 Attribute Name     Display
1978 archive            A
1979 hidden             H
1980 readonly           R
1981 system             S
1982 appendonly         a
1983 nodump             d
1984 immutable          i
1985 av_modified        m
1986 av_quarantined     q
1987 nounlink           u
1988 offline            O
1989 sparse             s
1990 .fi
1991 .in -2
1992 .sp
1993 
1994 .sp
1995 .LP
1996 The display in verbose mode (\fB-/ v\fR) uses full attribute names when it is set and
1997 the name prefixed by 'no' when it is not set.
1998 .sp
1999 .LP
2000 The attribute name \fBcrtime\fR and all other timestamps are handled by the
2001 option \fB-%\fR with the respective timestamp option arguments and also with
2002 \fBall\fR option argument. The display positions are as follows: The display in
2003 verbose mode (\fB-/ v\fR) uses full attribute names  when it is set and the
2004 name prefixed by \fBno\fR when it is not set. The attribute name \fBcrtime\fR
2005 and all other timestamps are handled by the option \fB-%\fR with the respective
2006 timestamp option arguments and also with \fBall\fR option argument.
2007 .sp
2008 .LP
2009 The display positions are as follows:
2010 .sp
2011 .in +2
2012 .nf
2013 {||||||||||||}
2014  |||||||||||+- s (sparse)
2015  ||||||||||+-- O (offline)
2016  |||||||||+--- u (nounlink)
2017  ||||||||+---- q (av_quarantined)
2018  |||||||+----- m (av_modified)
2019  ||||||+------ i (immutable)
2020  |||||+------- d (nodump)
2021  ||||+-------- a (appendonly)
2022  |||+--------- S (system)
2023  ||+---------- R (readonly)
2024  |+----------- H (hidden)
2025  +------------ A (archive)
2026 .fi
2027 .in -2
2028 .sp
2029 
2030 .sp
2031 .in +2
2032 .nf
2033 -% atime | crtime | ctime | mtime | all
2034 .fi
2035 .in -2
2036 .sp
2037 
2038 .sp
2039 .ne 2
2040 .na
2041 \fB\fBatime\fR\fR
2042 .ad
2043 .sp .6
2044 .RS 4n
2045 Equivalent to \fB-u\fR.
2046 .RE
2047 
2048 .sp
2049 .ne 2
2050 .na
2051 \fB\fBcrtime\fR\fR
2052 .ad
2053 .sp .6
2054 .RS 4n
2055 Uses the creation time of the file for sorting or printing.
2056 .RE
2057 
2058 .sp
2059 .ne 2
2060 .na
2061 \fB\fBctime\fR\fR
2062 .ad
2063 .sp .6
2064 .RS 4n
2065 Equivalent to \fB-c\fR.
2066 .RE
2067 
2068 .sp
2069 .ne 2
2070 .na
2071 \fB\fBmtime\fR\fR
2072 .ad
2073 .sp .6
2074 .RS 4n
2075 Uses the last modification time of the file contents for sorting or printing.
2076 .RE
2077 
2078 .sp
2079 .LP
2080 If extended system attributes are not supported or if the user does not have
2081 \fBread\fR permission on the file or if the \fBcrtime\fR extended attribute is
2082 not set, \fBcrtime\fR is treated as a synonym for \fBmtime\fR.
2083 .sp
2084 .LP
2085 When option argument \fBall\fR is specified, all available timestamps are
2086 printed which includes \fBatime\fR, \fBctime\fR, \fBmtime\fR and on the
2087 extended system attribute supporting file systems, \fBcrtime\fR (create time).
2088 The option \fB-% all\fR does not effect which timestamp is displayed in long
2089 format and does not affect sorting.
2090 .sp
2091 .ne 2
2092 .na
2093 \fB\fB--block-size\fR \fIsize\fR\fR
2094 .ad
2095 .sp .6
2096 .RS 4n
2097 Display sizes in multiples of size. Size can be scaled by suffixing one of
2098 \fBYyZzEePpTtGgMmKk\fR. Additionally, a \fBB\fR can be placed at the end to
2099 indicate powers of 10 instead of 2. For example, . \fB10mB\fR means blocks of
2100 \fB10000000\fR bytes while \fB10m\fR means blocks of \fB10*2^20 -- 10485760
2101 --\fR bytes. This is mutually exclusive with the \fB-h\fR option.
2102 .RE
2103 
2104 .sp
2105 .ne 2
2106 .na
2107 \fB\fB--color\fR \fB[=\fR\fIwhen\fR\fB]\fR\fR
2108 .ad
2109 .br
2110 .na
2111 \fB\fB--colour\fR\fB[=\fR\fIwhen\fR\fB]\fR\fR
2112 .ad
2113 .sp .6
2114 .RS 4n
2115 Display filenames using color on color-capable terminals. \fIwhen\fR is an
2116 optional argument that determines when to display color output.
2117 .sp
2118 Possible values for \fIwhen\fR are:
2119 .sp
2120 .ne 2
2121 .na
2122 \fB\fBalways\fR\fR
2123 .ad
2124 .br
2125 .na
2126 \fB\fByes\fR\fR
2127 .ad
2128 .br
2129 .na
2130 \fB\fBforce\fR\fR
2131 .ad
2132 .sp .6
2133 .RS 4n
2134 Always use color.
2135 .RE
2136 
2137 .sp
2138 .ne 2
2139 .na
2140 \fB\fBauto\fR\fR
2141 .ad
2142 .br
2143 .na
2144 \fB\fBtty\fR\fR
2145 .ad
2146 .br
2147 .na
2148 \fB\fBif-tty\fR\fR
2149 .ad
2150 .sp .6
2151 .RS 4n
2152 Use color if a terminal is present.
2153 .RE
2154 
2155 .sp
2156 .ne 2
2157 .na
2158 \fB\fBno\fR\fR
2159 .ad
2160 .br
2161 .na
2162 \fB\fBnever\fR\fR
2163 .ad
2164 .br
2165 .na
2166 \fB\fBnone\fR\fR
2167 .ad
2168 .sp .6
2169 .RS 4n
2170 Never use color. This is the default
2171 .RE
2172 
2173 See \fBCOLOR OUTPUT\fR for information on how to control the output colors.
2174 .RE
2175 
2176 .sp
2177 .ne 2
2178 .na
2179 \fB\fB--file-type\fR\fR
2180 .ad
2181 .sp .6
2182 .RS 4n
2183 Display a suffix after a file depending on it's type, similar to the \fB-F\fR
2184 option, except \fB*\fR is not appended to executable files.
2185 .RE
2186 
2187 .sp
2188 .ne 2
2189 .na
2190 \fB\fB-si\fR\fR
2191 .ad
2192 .br
2193 .na
2194 \fB\fB--\fR\fR
2195 .ad
2196 .sp .6
2197 .RS 4n
2198 Display human scaled sizes similar to the \fB-h\fR option, except values are
2199 repeatedly divided by 1000 instead of 1024. The last option \fB--si\fR or
2200 \fB-h\fR determines the divisor used.
2201 .RE
2202 
2203 .sp
2204 .ne 2
2205 .na
2206 \fB\fB--time-style\fR style\fR
2207 .ad
2208 .sp .6
2209 .RS 4n
2210 Display times using the specified style. This does not effect the times
2211 displayed for extended attributes (\fB-%\fR).
2212 .sp
2213 Possible values for \fIstyle\fR are:
2214 .sp
2215 .ne 2
2216 .na
2217 \fB\fBfull-iso\fR\fR
2218 .ad
2219 .sp .6
2220 .RS 4n
2221 Equivalent to \fB-E\fR.
2222 .RE
2223 
2224 .sp
2225 .ne 2
2226 .na
2227 \fB\fBlong-iso\fR\fR
2228 .ad
2229 .sp .6
2230 .RS 4n
2231 Display in \fIYYYY-MM-DD HH:MM\fR for all files.
2232 .RE
2233 
2234 .sp
2235 .ne 2
2236 .na
2237 \fB\fBiso\fR\fR
2238 .ad
2239 .sp .6
2240 .RS 4n
2241 Display older files using \fIYYYY-MM-DD\fR and newer files with \fIMM-DD
2242 HH:MM\fR.
2243 .RE
2244 
2245 .sp
2246 .ne 2
2247 .na
2248 \fB\fBlocale\fR\fR
2249 .ad
2250 .sp .6
2251 .RS 4n
2252 Use the default locale format for old and new files. This is the default.
2253 .RE
2254 
2255 .sp
2256 .ne 2
2257 .na
2258 \fB\fB+FORMAT\fR\fR
2259 .ad
2260 .sp .6
2261 .RS 4n
2262 Use a custom format. Values are the same as described in \fBstrftime\fR(3C). If
2263 a NEWLINE appears in the string, the first line is used for older files and the
2264 second line is used for newer files. Otherwise, the given format is used for
2265 all files.
2266 .RE
2267 
2268 .RE
2269 
2270 .SS "/usr/bin/ls"
2271 .ne 2
2272 .na
2273 \fB\fB-F\fR\fR
2274 .ad
2275 .sp .6
2276 .RS 4n
2277 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2278 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2279 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2280 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2281 with a trailing equals sign (\fB=\fR). Follows \fBsymlinks\fR named as
2282 operands.
2283 .RE
2284 
2285 .sp
2286 .ne 2
2287 .na
2288 \fB\fB--file-type\fR\fR
2289 .ad
2290 .sp .6
2291 .RS 4n
2292 Marks entries as with \fB-F\fR with the exception of executable files.
2293 Executable files are not marked. Follows symlinks named as operands.
2294 .RE
2295 
2296 .sp
2297 .LP
2298 Specifying more than one of the options in the following mutually exclusive
2299 pairs is not considered an error: \fB-C\fR and \fB-l\fR (ell), \fB-m\fR and
2300 \fB-l\fR (ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR (ell). The
2301 \fB-l\fR option overrides the other option specified in each pair.
2302 .sp
2303 .LP
2304 Specifying more than one of the options in the following mutually exclusive
2305 groups is not considered an error: \fB-C\fR and \fB-1\fR (one), \fB-H\fR and
2306 \fB-L\fR, \fB-c\fR and \fB-u\fR, and \fB-e\fR and \fB-E\fR, and \fB-t\fR and
2307 \fB-S\fR. The last option specifying a specific timestamp (\fB-c\fR, \fB-u\fR,
2308 \fB-% atime\fR , \fB-% crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR)
2309 determines the timestamps used for sorting or in long format listings. The last
2310 option \fB-t\fR, \fB-S\fR, or \fB-U\fR determines the sorting behavior.
2311 .SS "/usr/xpg4/bin/ls"
2312 .ne 2
2313 .na
2314 \fB\fB-F\fR\fR
2315 .ad
2316 .sp .6
2317 .RS 4n
2318 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2319 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2320 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2321 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2322 with a trailing equals sign (\fB=\fR). Follows symlinks named as operands.
2323 .RE
2324 
2325 .sp
2326 .ne 2
2327 .na
2328 \fB\fB--file-type\fR\fR
2329 .ad
2330 .sp .6
2331 .RS 4n
2332 Marks entries as with \fB-F\fR with the exception of executable files.
2333 Executable files are not marked. Follows symlinks named as operands.
2334 .RE
2335 
2336 .sp
2337 .LP
2338 Specifying more than one of the options in the following groups of mutually
2339 exclusive options is not considered an error: \fB-C\fR and \fB-l\fR (ell),
2340 \fB-m\fR and \fB-l\fR (ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR
2341 (ell), \fB-C\fR and \fB-1\fR (one), \fB-H\fR and \fB-L\fR, \fB-c\fR and
2342 \fB-u\fR, \fB-e\fR and \fB-E\fR, \fB-t\fR and \fB-S\fR and \fB-U\fR. The last
2343 option specifying a specific timestamp (\fB-c\fR, \fB-u\fR, \fB-% atime\fR ,
2344 \fB-% crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR) determines the timestamps
2345 used for sorting or in long format listings. The last \fB-t\fR, \fB-S\fR, or
2346 \fB-U\fR option determines the sorting behavior.
2347 .SS "/usr/xpg6/bin/ls"
2348 .ne 2
2349 .na
2350 \fB\fB-F\fR\fR
2351 .ad
2352 .sp .6
2353 .RS 4n
2354 Marks directories with a trailing slash (\fB/\fR), doors with a trailing
2355 greater-than sign (\fB>\fR), executable files with a trailing asterisk
2356 (\fB*\fR), \fBFIFO\fRs with a trailing vertical bar (\fB|\fR), symbolic links
2357 with a trailing "at" sign (\fB@\fR), and \fBAF_UNIX\fR address family sockets
2358 with a trailing equals sign (\fB=\fR). Does not follow symlinks named as
2359 operands unless the \fB-H\fR or \fB-L\fR option is specified.
2360 .RE
2361 
2362 .sp
2363 .ne 2
2364 .na
2365 \fB\fB--file-type\fR\fR
2366 .ad
2367 .sp .6
2368 .RS 4n
2369 Marks entries as with \fB-F\fR with the exception of executable files.
2370 Executable files are not marked. Does not follow symlinks named as operands
2371 unless the \fB-H\fR or \fB-L\fR option is specified.
2372 .RE
2373 
2374 .sp
2375 .LP
2376 Specifying more than one of the options in the following mutually exclusive
2377 pairs is not considered an error: \fB-C\fR and \fB-l\fR (ell), m and
2378 \fB-l\fR(ell), \fB-x\fR and \fB-l\fR (ell), \fB-@\fR and \fB-l\fR (ell),
2379 \fB-C\fR and \fB-1\fR (one), \fB-H\fR and -\fB-L\fR, \fB-c\fR and \fB-u\fR,
2380 \fB-e\fR and \fB-E\fR, \fB-t\fR and \fB-S\fR and \fB-U\fR. The last option
2381 specifying a specific timestamp (\fB-c\fR, \fB-u\fR, \fB-% atime\fR , \fB-%
2382 crtime\fR, \fB-% ctime\fR, and \fB-% mtime\fR) determines the timestamps used
2383 for sorting or in long format listings. The last \fB-t\fR, \fB-S\fR, or
2384 \fB-U\fR option determines the sorting behavior.
2385 .SH OPERANDS
2386 .LP
2387 The following operand is supported:
2388 .sp
2389 .ne 2
2390 .na
2391 \fB\fIfile\fR\fR
2392 .ad
2393 .sp .6
2394 .RS 4n
2395 A path name of a file to be written. If the file specified is not found, a
2396 diagnostic message is output on standard error.
2397 .RE
2398 
2399 .SH USAGE
2400 .LP
2401 See \fBlargefile\fR(5) for the description of the behavior of \fBls\fR when
2402 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
2403 .SH EXAMPLES
2404 .LP
2405 \fBExample 1 \fRViewing File Permissions
2406 .sp
2407 .LP
2408 The following example shows how to display detailed information about a file.
2409 
2410 .sp
2411 .in +2
2412 .nf
2413 % ls -l file.1
2414 -rw-r--r--   1 gozer    staff     206663 Mar 14 10:15 file.1
2415 .fi
2416 .in -2
2417 .sp
2418 
2419 .sp
2420 .LP
2421 The permissions string above (\fB-rw-r--r--\fR) describes that the file owner
2422 has read and write permissions, the owning group has read permissions, and
2423 others have read permissions.
2424 
2425 .sp
2426 .LP
2427 The following example shows how to display detailed information about a
2428 directory.
2429 
2430 .sp
2431 .in +2
2432 .nf
2433 % ls -ld test.dir
2434 drwxr-xr-x   2 gozer    staff          2 Mar 14 10:17 test.dir
2435 .fi
2436 .in -2
2437 .sp
2438 
2439 .sp
2440 .LP
2441 The permissions string above (\fBdrwxr-xr-x\fR) describes that the directory
2442 owner has read, write, and search permissions, the owning group has read and
2443 search permissions, and others have read and search permissions.
2444 
2445 .sp
2446 .LP
2447 Another example of listing file permissions is as follows:
2448 
2449 .sp
2450 .in +2
2451 .nf
2452 % ls -l file.2
2453 -rw-rwl---   1 gozer    staff     206663 Mar 14 10:47 file.2
2454 .fi
2455 .in -2
2456 .sp
2457 
2458 .sp
2459 .LP
2460 The permissions string above (\fB-rw-rwl---\fR) describes that the file owner
2461 has read and write permissions, the owning group has read and write
2462 permissions, and the file can be locked during access.
2463 
2464 .LP
2465 \fBExample 2 \fRDisplaying ACL Information on Files and Directories
2466 .sp
2467 .LP
2468 The following example shows how to display verbose ACL information on a ZFS
2469 file.
2470 
2471 .sp
2472 .in +2
2473 .nf
2474 % ls -v file.1
2475 -rw-r--r--   1 marks    staff     206663 Mar 14 10:15 file.1
2476      0:owner@:execute:deny
2477      1:owner@:read_data/write_data/append_data/write_xattr/write_attributes
2478           /write_acl/write_owner:allow
2479      2:group@:write_data/append_data/execute:deny
2480      3:group@:read_data:allow
2481      4:everyone@:write_data/append_data/write_xattr/execute/write_attributes
2482           /write_acl/write_owner:deny
2483      5:everyone@:read_data/read_xattr/read_attributes/read_acl/synchronize
2484           :allow
2485 .fi
2486 .in -2
2487 .sp
2488 
2489 .sp
2490 .LP
2491 The following example shows how to display compact ACL information on a ZFS
2492 directory.
2493 
2494 .sp
2495 .in +2
2496 .nf
2497 % ls -dV test.dir
2498 drwxr-xr-x   2 marks    staff          2 Mar 14 10:17 test.dir
2499             owner@:--------------:------:deny
2500             owner@:rwxp---A-W-Co-:------:allow
2501             group@:-w-p----------:------:deny
2502             group@:r-x-----------:------:allow
2503             everyone@:-w-p---A-W-Co-:------:deny
2504             everyone@:r-x---a-R-c--s:------:allow
2505 .fi
2506 .in -2
2507 .sp
2508 
2509 .sp
2510 .LP
2511 The following example illustrates the \fBls\fR \fB-v\fR behavior when listing
2512 ACL  information on a UFS file.
2513 
2514 .sp
2515 .in +2
2516 .nf
2517 $ ls -v file.3
2518 -rw-r--r--   1 root     root        2703 Mar 14 10:59 file.3
2519      0:user::rw-
2520      1:group::r--               #effective:r--
2521      2:mask:r--
2522      3:other:r--
2523 .fi
2524 .in -2
2525 .sp
2526 
2527 .LP
2528 \fBExample 3 \fRPrinting the Names of All Files
2529 .sp
2530 .LP
2531 The following example prints the names of all files in the current directory,
2532 including those that begin with a dot (\fB\&.\fR), which normally do not print:
2533 
2534 .sp
2535 .in +2
2536 .nf
2537 example% \fBls -a\fR
2538 .fi
2539 .in -2
2540 .sp
2541 
2542 .LP
2543 \fBExample 4 \fRProviding File Information
2544 .sp
2545 .LP
2546 The following example provides file information:
2547 
2548 .sp
2549 .in +2
2550 .nf
2551 example% ls -aisn
2552 .fi
2553 .in -2
2554 .sp
2555 
2556 .sp
2557 .LP
2558 This command provides information on \fBa\fRll files, including those that
2559 begin with a dot (\fBa\fR), the \fBi\fR-number, the memory address of the
2560 i-node associated with the file\(emprinted in the left-hand column (\fBi\fR);
2561 the \fBs\fRize (in blocks) of the files, printed in the column to the right of
2562 the i-numbers (\fBs\fR); finally, the report is displayed in the \fBn\fRumeric
2563 version of the long list, printing the \fBUID\fR (instead of user name) and
2564 \fBGID\fR (instead of group name) numbers associated with the files.
2565 
2566 .sp
2567 .LP
2568 When the sizes of the files in a directory are listed, a total count of blocks,
2569 including indirect blocks, is printed.
2570 
2571 .LP
2572 \fBExample 5 \fRProviding Extended System Attributes Information
2573 .sp
2574 .in +2
2575 .nf
2576 example% ls -/ c file    (extended system attribute in compact mode)
2577 -rw-r--r--   1 root     root           0 May 10 14:17 file
2578                          {AHRSadim-u--}
2579 .fi
2580 .in -2
2581 .sp
2582 
2583 .sp
2584 .LP
2585 In this example, \fBav_quarantined\fR, \fBoffline\fR, and \fBsparse\fR
2586 are not set.
2587 .sp
2588 .in +2
2589 .nf
2590 example% ls -/ v file (extended system attribute in verbose mode)
2591 -rw-r--r--   1 root     root           0 May 10 14:17 file
2592                 {archive,hidden,readonly,system,\e
2593                  appendonly,nodump,immutable,av_modified,\e
2594                  noav_quarantined,nounlink,nooffline,\e
2595                  nosparse}
2596 
2597 example% ls -/ v file     (no extended system attribute)
2598 -rw-r--r--  1 root    staff        0 May 16 14:48 file
2599                {}
2600 
2601 example% ls -/ c file        (extended system attribute
2602                               supported file system)
2603 
2604 -rw-r--r--  1 root staff        3 Jun  4 22:04 file
2605                {A------m----}
2606 .fi
2607 .in -2
2608 .sp
2609 
2610 .sp
2611 .LP
2612 \fBarchive\fR and \fBav_modified\fR attributes are set by default on  an
2613 extended system attribute supported file.
2614 .sp
2615 .in +2
2616 .nf
2617 example% ls -/ c  -%crtime file
2618 
2619 -rw-r--r--    root     root          0 May 10 14:17 file
2620                {AHRSadim-u--}
2621 .fi
2622 .in -2
2623 .sp
2624 
2625 .sp
2626 .LP
2627 This example displays the timestamp as the creation time:
2628 .sp
2629 .in +2
2630 .nf
2631 example% ls -l -%all file
2632 -rw-r--r--   1 root     root           0 May 10 14:17    file
2633                 timestamp: atime    Jun 14 08:47:37 2007
2634                 timestamp: ctime    May 10 14:20:23 2007
2635                 timestamp: mtime    May 10 14:17:56 2007
2636                 timestamp: crtime   May 10 14:17:56 2007
2637 
2638 example% ls -%crtime -tl file*
2639 
2640 -rw-r--r--   1 foo      staff          3 Jun  4 22:04 file1
2641 -rw-r--r--   1 root     root           0 May 10 14:17 file
2642 -rw-r--r--   1 foo      staff          0 May  9 13:49 file.1
2643 .fi
2644 .in -2
2645 .sp
2646 
2647 .sp
2648 .LP
2649 In this example the files are sorted by creation time.
2650 .SH ENVIRONMENT VARIABLES
2651 .LP
2652 See \fBenviron\fR(5) for descriptions of the following environment variables
2653 that affect the execution of \fBls\fR: \fBLANG\fR, \fBLC_ALL\fR,
2654 \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_TIME\fR, \fBLC_MESSAGES\fR,
2655 \fBNLSPATH\fR, and \fBTZ\fR.
2656 .sp
2657 .ne 2
2658 .na
2659 \fB\fBCOLUMNS\fR\fR
2660 .ad
2661 .sp .6
2662 .RS 4n
2663 Determines the user's preferred column position width for writing multiple
2664 text-column output. If this variable contains a string representing a decimal
2665 integer, the \fBls\fR utility calculates how many path name text columns to
2666 write (see \fB-C\fR) based on the width provided. If \fBCOLUMNS\fR is not set
2667 or is invalid, 80 is used. The column width chosen to write the names of files
2668 in any given directory is constant. File names are not be truncated to fit into
2669 the multiple text-column output.
2670 .RE
2671 
2672 .sp
2673 .ne 2
2674 .na
2675 \fB\fBLS_COLORS\fR\fR
2676 .ad
2677 .sp .6
2678 .RS 4n
2679 Determines the coloring scheme used when displaying color output. If not set
2680 and color output is specified, a default scheme is used. If TERM is not set, no
2681 color output is used.
2682 .RE
2683 
2684 .sp
2685 .ne 2
2686 .na
2687 \fB\fBTERM\fR\fR
2688 .ad
2689 .sp .6
2690 .RS 4n
2691 Determine the terminal type. If this variable is unset or NULL, no color output
2692 is generated regardless of the value of the --color option.
2693 .RE
2694 
2695 .SH EXIT STATUS
2696 .ne 2
2697 .na
2698 \fB\fB0\fR\fR
2699 .ad
2700 .RS 6n
2701 All information was written successfully.
2702 .RE
2703 
2704 .sp
2705 .ne 2
2706 .na
2707 \fB\fB>0\fR\fR
2708 .ad
2709 .RS 6n
2710 An error occurred.
2711 .RE
2712 
2713 .SH FILES
2714 .ne 2
2715 .na
2716 \fB\fB/etc/group\fR\fR
2717 .ad
2718 .sp .6
2719 .RS 4n
2720 group IDs for \fBls\fR \fB-l\fR and \fBls\fR \fB-g\fR
2721 .RE
2722 
2723 .sp
2724 .ne 2
2725 .na
2726 \fB\fB/etc/passwd\fR\fR
2727 .ad
2728 .sp .6
2729 .RS 4n
2730 user IDs for \fBls\fR \fB-l\fR and \fBls\fR \fB-o\fR
2731 .RE
2732 
2733 .sp
2734 .ne 2
2735 .na
2736 \fB\fB/usr/share/lib/terminfo/?/*\fR\fR
2737 .ad
2738 .sp .6
2739 .RS 4n
2740 terminal information database
2741 .RE
2742 
2743 .SH ATTRIBUTES
2744 .LP
2745 See \fBattributes\fR(5) for descriptions of the following attributes:
2746 .SS "/usr/bin/ls"
2747 
2748 .TS
2749 box;
2750 c | c
2751 l | l .
2752 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2753 _
2754 CSI     Enabled
2755 _
2756 Interface Stability     Committed
2757 _
2758 Standard        See below.
2759 .TE
2760 
2761 .sp
2762 .LP
2763 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2764 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2765 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2766 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2767 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2768 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2769 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2770 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2771 .SS "/usr/xpg4/bin/ls"
2772 
2773 .TS
2774 box;
2775 c | c
2776 l | l .
2777 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2778 _
2779 CSI     Enabled
2780 _
2781 Interface Stability     Committed
2782 _
2783 Standard        See below.
2784 .TE
2785 
2786 .sp
2787 .LP
2788 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2789 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2790 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2791 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2792 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2793 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2794 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2795 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2796 .SS "/usr/xpg6/bin/ls"
2797 
2798 .TS
2799 box;
2800 c | c
2801 l | l .
2802 ATTRIBUTE TYPE  ATTRIBUTE VALUE
2803 _
2804 CSI     Enabled
2805 _
2806 Interface Stability     Committed
2807 _
2808 Standard        See below.
2809 .TE
2810 
2811 .sp
2812 .LP
2813 For all options except \fB-A\fR, \fB-b\fR, \fB-e\fR, \fB-E,\fR \fB-h\fR,
2814 \fB-S\fR, U \fB-v\fR, \fB-V\fR, \fB-@\fR, \fB-/\fR, \fB-%\fR, \fB--all\fR,
2815 \fB--almost-all\fR, \fB--block-size\fR, \fB--classify\fR, \fB--color\fR,
2816 \fB--colour\fR, \fB--dereference\fR, \fB--dereference-command-line\fR,
2817 \fB--escape\fR, \fB--file-type\fR, \fB--full-time\fR, \fB--human-readable\fR,
2818 \fB--ignore-backups\fR, \fB--inode\fR, \fB--no-group\fR,
2819 \fB--numeric-uid-gid\fR, \fB--reverse\fR, \fB--recursive\fR, \fB--si\fR,
2820 \fB--size\fR, and \fB--time-style\fR, see \fBstandards\fR(5).
2821 .SH SEE ALSO
2822 .LP
2823 \fBchmod\fR(1), \fBcp\fR(1), \fBsetfacl\fR(1), \fBfgetattr\fR(3C),
2824 \fBstrftime\fR(3C), \fBterminfo\fR(4), \fBacl\fR(5), \fBattributes\fR(5),
2825 \fBenviron\fR(5), \fBfsattr\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5),
2826 \fBidmapd\fR(1M)
2827 .SH NOTES
2828 .LP
2829 Unprintable characters in file names can confuse the columnar output options.
2830 .sp
2831 .LP
2832 The total block count is incorrect if there are hard links among the files.
2833 .sp
2834 .LP
2835 The sort order of \fBls\fR output is affected by the locale and can be
2836 overridden by the \fBLC_COLLATE\fR environment variable. For example, if
2837 \fBLC_COLLATE\fR equals \fBC\fR, dot files appear first, followed by names
2838 beginning with upper-case letters, then followed by names beginning with
2839 lower-case letters. But if \fBLC_COLLATE\fR equals \fBen_US.ISO8859-1\fR, then
2840 leading dots as well as case are ignored in determining the sort order.
2841 .sp
2842 .LP
2843 For additional information regarding Windows Security Identifiers, consult
2844 Microsoft support document, \fIWell-known security identifiers in Windows
2845 operating systems\fR, which can be found at Microsoft's support site: https://support.microsoft.com/en-us/kb/243330/.