Print this page
    
NEX-1767 ls is unable to display SIDs
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/man/man1/ls.1.man.txt
          +++ new/usr/src/man/man1/ls.1.man.txt
   1    1  LS(1)                            User Commands                           LS(1)
   2    2  
   3    3  
   4    4  
   5    5  NAME
   6    6         ls - list contents of directory
   7    7  
   8    8  SYNOPSIS
   9    9         /usr/bin/ls [-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@]
  10   10              [-/ c | v] [-% atime | crtime | ctime | mtime | all]
  11   11              [--block-size size] [--color[=when]] [--file-type]
  12   12              [--si] [--time-style style] [file]...
  13   13  
  14   14  
  15   15         /usr/xpg4/bin/ls [-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@]
  16   16              [-/ c | v] [-% atime | crtime | ctime | mtime | all]
  17   17              [--block-size size] [--color[=when]] [--file-type]
  18   18              [--si] [--time-style style] [file]...
  19   19  
  20   20  
  21   21         /usr/xpg6/bin/ls [-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@]
  22   22              [-/ c | v] [-% atime | crtime | ctime | mtime | all]
  23   23              [--block-size size] [--color[=when]] [--file-type]
  24   24              [--si] [--time-style style] [file]...
  25   25  
  26   26  
  27   27  DESCRIPTION
  28   28         For each file that is a directory, ls lists the contents of the
  29   29         directory. For each file that is an ordinary file, ls repeats its name
  30   30         and any other information requested. The output is sorted
  31   31         alphabetically by default. When no argument is given, the current
  32   32         directory (.) is listed. When several arguments are given, the
  33   33         arguments are first sorted appropriately, but file arguments appear
  34   34         before directories and their contents.
  35   35  
  36   36  
  37   37         There are three major listing formats. The default format for output
  38   38         directed to a terminal is multi-column with entries sorted down the
  39   39         columns. The -1 option allows single column output and -m enables
  40   40         stream output format. In order to determine output formats for the -C,
  41   41         -x, and -m options, ls uses an environment variable, COLUMNS, to
  42   42         determine the number of character positions available on one output
  43   43         line. If this variable is not set, the terminfo(4) database is used to
  44   44         determine the number of columns, based on the environment variable,
  45   45         TERM. If this information cannot be obtained, 80 columns are assumed.
  46   46         If the -w option is used, the argument overrides any other column
  47   47         width.
  48   48  
  49   49  
  50   50         The mode printed when the -e, -E, -g, -l, -n, -o, -v, -V, or -@ option
  51   51         is in effect consists of eleven characters. The first character can be
  52   52         one of the following:
  53   53  
  54   54         d
  55   55  
  56   56             The entry is a directory.
  57   57  
  58   58  
  59   59         D
  60   60  
  61   61             The entry is a door.
  62   62  
  63   63  
  64   64         l
  65   65  
  66   66             The entry is a symbolic link.
  67   67  
  68   68  
  69   69         b
  70   70  
  71   71             The entry is a block special file.
  72   72  
  73   73  
  74   74         c
  75   75  
  76   76             The entry is a character special file.
  77   77  
  78   78  
  79   79         p
  80   80  
  81   81             The entry is a FIFO (or "named pipe") special file.
  82   82  
  83   83  
  84   84         P
  85   85  
  86   86             The entry is an event port.
  87   87  
  88   88  
  89   89         s
  90   90  
  91   91             The entry is an AF_UNIX address family socket.
  92   92  
  93   93  
  94   94         -
  95   95  
  96   96             The entry is an ordinary file.
  97   97  
  98   98  
  99   99  
 100  100         The next 9 characters are interpreted as three sets of three bits each.
 101  101         The first set refers to the owner's permissions; the next to
 102  102         permissions of others in the user-group of the file; and the last to
 103  103         all others. Within each set, the three characters indicate permission
 104  104         to read, to write, and to execute the file as a program, respectively.
 105  105         For a directory, execute permission is interpreted to mean permission
 106  106         to search the directory for a specified file.  The character after
 107  107         permissions is an ACL or extended attributes indicator.  This character
 108  108         is an @ if extended attributes are associated with the file and the -@
 109  109         option is in effect. Otherwise, this character is a plus sign (+)
 110  110         character if a non-trivial ACL is associated with the file or a space
 111  111         character if not.
 112  112  
 113  113  
 114  114         If -/ and/or -% are in effect, then the extended system attributes are
 115  115         printed when filesystem supports extended system attributes. The
 116  116         display looks as follows:
 117  117  
 118  118           $ls -/ c  file
 119  119           -rw-r--r--   1 root     root           0 May 10 14:17 file
 120  120                           {AHRSadim-u--}
 121  121  
 122  122           $ls -/ v file
 123  123           -rw-r--r--   1 root     root           0 May 10 14:17 file
 124  124                           {archive,hidden,readonly,system,\
 125  125                            appendonly,nodump,immutable,av_modified,\
 126  126                            noav_quarantined,nounlink,nooffline,\
 127  127                            nosparse}
 128  128  
 129  129           $ls -l -% all file
 130  130           -rw-r--r--   1 root     root           0 May 10 14:17 file
 131  131                           timestamp: atime    Jun 25 12:56:44 2007
 132  132                           timestamp: ctime    May 10 14:20:23 2007
 133  133                           timestamp: mtime    May 10 14:17:56 2007
 134  134                           timestamp: crtime   May 10 14:17:56 2007
 135  135  
 136  136  
 137  137  
 138  138  
 139  139         See the option descriptions of the -/ and -% option for details.
 140  140  
 141  141  
 142  142         ls -l (the long list) prints its output as follows for the POSIX
 143  143         locale:
 144  144  
 145  145           -rwxrwxrwx+ 1 smith dev   10876  May 16 9:42 part2
 146  146  
 147  147  
 148  148  
 149  149  
 150  150         Reading from right to left, you see that the current directory holds
 151  151         one file, named part2. Next, the last time that file's contents were
 152  152         modified was 9:42 A.M. on May 16. The file contains 10,876 characters,
 153  153         or bytes.  The owner of the file, or the user, belongs to the group dev
 154  154         (perhaps indicating development), and his or her login name is smith.
 155  155         The number, in this case 1, indicates the number of links to file part2
 156  156         (see cp(1)). The plus sign indicates that there is an ACL associated
 157  157         with the file. If the -@ option has been specified, the presence of
 158  158         extended attributes supersede the presence of an ACL and the plus sign
 159  159         is replaced with an 'at' sign (@). Finally, the dash and letters tell
 160  160         you that user, group, and others have permissions to read, write, and
 161  161         execute part2.
 162  162  
 163  163  
 164  164         The execute (x) symbol occupies the third position of the three-
 165  165         character sequence. A - in the third position would have indicated a
 166  166         denial of execution permissions.
 167  167  
 168  168  
 169  169         The permissions are indicated as follows:
 170  170  
 171  171         r
 172  172  
 173  173             The file is readable.
 174  174  
 175  175  
 176  176         w
 177  177  
 178  178             The file is writable.
 179  179  
 180  180  
 181  181         x
 182  182  
 183  183             The file is executable.
 184  184  
 185  185  
 186  186         -
 187  187  
 188  188             The indicated permission is not granted.
 189  189  
 190  190  
 191  191         s
 192  192  
 193  193             The set-user-ID or set-group-ID bit is on, and the corresponding
 194  194             user or group execution bit is also on.
 195  195  
 196  196  
 197  197         S
 198  198  
 199  199             Undefined bit-state (the set-user-ID or set-group-id bit is on and
 200  200             the user or group execution bit is off). For group permissions,
 201  201             this applies only to non-regular files.
 202  202  
 203  203  
 204  204         t
 205  205  
 206  206             The 1000 (octal) bit, or sticky bit, is on (see chmod(1)), and
 207  207             execution is on.
 208  208  
 209  209  
 210  210         T
 211  211  
 212  212             The 1000 bit is turned on, and execution is off (undefined bit-
 213  213             state).
 214  214  
 215  215  
 216  216     /usr/bin/ls
 217  217         l
 218  218  
 219  219             Mandatory locking occurs during access (on a regular file, the set-
 220  220             group-ID bit is on and the group execution bit is off).
 221  221  
 222  222  
 223  223     /usr/xpg4/bin/ls and /usr/xpg6/bin/ls
 224  224         L
 225  225  
 226  226             Mandatory locking occurs during access (on a regular file, the set-
 227  227             group-ID bit is on and the group execution bit is off).
 228  228  
 229  229  
 230  230  
 231  231         For user and group permissions, the third position is sometimes
 232  232         occupied by a character other than x or -. s or S also can occupy this
 233  233         position, referring to the state of the set-ID bit, whether it be the
 234  234         user's or the group's. The ability to assume the same ID as the user
 235  235         during execution is, for example, used during login when you begin as
 236  236         root but need to assume the identity of the user you login as.
 237  237  
 238  238  
 239  239         In the case of the sequence of group permissions, l can occupy the
 240  240         third position. l refers to mandatory file and record locking. This
 241  241         permission describes a file's ability to allow other files to lock its
 242  242         reading or writing permissions during access.
 243  243  
 244  244  
 245  245         For others permissions, the third position can be occupied by t or T.
 246  246         These refer to the state of the sticky bit and execution permissions.
 247  247  
 248  248     Color Output
 249  249         If color output is enabled, the environment variable LS_COLORS is
 250  250         checked.  If it exists, it's contents are used to control the colors
 251  251         used to display filenames.  If it is not set, a default list of colors
 252  252         is used. The format of LS_COLORS is a colon separated list of attribute
 253  253         specifications. Each attribute specification is of the format
 254  254  
 255  255           filespec=attr[;attr..]
 256  256  
 257  257  
 258  258  
 259  259  
 260  260         filespec is either of the form *.SUFFIX, for example, *.jar or *.Z, or
 261  261         one of the following file types:
 262  262  
 263  263         no
 264  264  
 265  265             Normal file
 266  266  
 267  267  
 268  268         fi
 269  269  
 270  270             Regular file
 271  271  
 272  272  
 273  273         di
 274  274  
 275  275             Directory
 276  276  
 277  277  
 278  278         ln
 279  279  
 280  280             Symbolic link
 281  281  
 282  282  
 283  283         pi
 284  284  
 285  285             FIFO or named pipe
 286  286  
 287  287  
 288  288         so
 289  289  
 290  290             Socket
 291  291  
 292  292  
 293  293         do
 294  294  
 295  295             Door file
 296  296  
 297  297  
 298  298         bd
 299  299  
 300  300             Block device
 301  301  
 302  302  
 303  303         cd
 304  304  
 305  305             Character device
 306  306  
 307  307  
 308  308         ex
 309  309  
 310  310             Execute bit (either user, group, or other) set
 311  311  
 312  312  
 313  313         po
 314  314  
 315  315             Event port
 316  316  
 317  317  
 318  318         st
 319  319  
 320  320             Sticky bit set
 321  321  
 322  322  
 323  323         or
 324  324  
 325  325             Orphaned symlink
 326  326  
 327  327  
 328  328         sg
 329  329  
 330  330             setgid binary
 331  331  
 332  332  
 333  333         su
 334  334  
 335  335             setuid binary
 336  336  
 337  337  
 338  338         ow
 339  339  
 340  340             world writable
 341  341  
 342  342  
 343  343         tw
 344  344  
 345  345             Sticky bit and world writable
 346  346  
 347  347  
 348  348  
 349  349         attr is a semicolon delimited list of color and display attributes
 350  350         which are combined to determine the final output color. Any combination
 351  351         of attr values can be specified. Possible attr values are:
 352  352  
 353  353         00
 354  354  
 355  355             All attributes off (default terminal color)
 356  356  
 357  357  
 358  358         01
 359  359  
 360  360             Display text in bold
 361  361  
 362  362  
 363  363         04
 364  364  
 365  365             Display text with an underscore
 366  366  
 367  367  
 368  368         05
 369  369  
 370  370             Display text in bold
 371  371  
 372  372  
 373  373         07
 374  374  
 375  375             Display text with foreground and background colors reversed
 376  376  
 377  377  
 378  378         08
 379  379  
 380  380             Display using concealed text.
 381  381  
 382  382  
 383  383  
 384  384         One of the following values can be chosen. If multiple values are
 385  385         specified, the last specified value is used.
 386  386  
 387  387         30
 388  388  
 389  389             Set foreground to black.
 390  390  
 391  391  
 392  392         31
 393  393  
 394  394             Set foreground to red.
 395  395  
 396  396  
 397  397         32
 398  398  
 399  399             Set foreground to green.
 400  400  
 401  401  
 402  402         33
 403  403  
 404  404             Set foreground to yellow.
 405  405  
 406  406  
 407  407         34
 408  408  
 409  409             Set foreground to blue.
 410  410  
 411  411  
 412  412         35
 413  413  
 414  414             Set foreground to magenta (purple).
 415  415  
 416  416             Set foreground to .
 417  417  
 418  418  
 419  419         36
 420  420  
 421  421             Set foreground to cyan.
 422  422  
 423  423  
 424  424         37
 425  425  
 426  426             Set foreground to white.
 427  427  
 428  428  
 429  429         39
 430  430  
 431  431             Set foreground to default terminal color.
 432  432  
 433  433  
 434  434  
 435  435         One of the following can be specified. If multiple values are
 436  436         specified, the last value specified is used.
 437  437  
 438  438         40
 439  439  
 440  440             Set foreground to black.
 441  441  
 442  442  
 443  443         41
 444  444  
 445  445             Set foreground to red.
 446  446  
 447  447  
 448  448         42
 449  449  
 450  450             Set foreground to green.
 451  451  
 452  452  
 453  453         43
 454  454  
 455  455             Set foreground to yellow.
 456  456  
 457  457  
 458  458         44
 459  459  
 460  460             Set foreground to blue.
 461  461  
 462  462  
 463  463         45
 464  464  
 465  465             Set foreground to magenta (purple).
 466  466  
 467  467  
 468  468         46
 469  469  
 470  470             Set foreground to cyan.
 471  471  
 472  472  
 473  473         47
 474  474  
 475  475             Set foreground to white.
 476  476  
 477  477  
 478  478         49
 479  479  
 480  480             Set foreground to default terminal color.
 481  481  
 482  482  
 483  483  
 484  484         On some terminals, setting the bold attribute causes the foreground
 485  485         colors to be high-intensity, that is, brighter. In such cases the low-
 486  486         intensity yellow is often displayed as a brown or orange color.
 487  487  
 488  488  
 489  489         At least one attribute must be listed for a file specification.
 490  490  
 491  491  
 492  492         The appropriate color codes are chosen by selecting the most specific
 493  493         match, starting with the file suffixes and proceeding with the file
 494  494         types until a match is found. The no (normal file) type matches any
 495  495         file.
 496  496  
 497  497  OPTIONS
 498  498         The following options are supported:
 499  499  
 500  500     /usr/bin/ls, /usr/xpg4/bin/ls, and /usr/xpg6/bin/ls
 501  501         The following options are supported for all three versions:
 502  502  
 503  503         -a
 504  504         --all
 505  505  
 506  506             Lists all entries, including those that begin with a dot (.), which
 507  507             are normally not listed.
 508  508  
 509  509  
 510  510         -A
 511  511         --almost-all
 512  512  
 513  513             Lists all entries, including those that begin with a dot (.), with
 514  514             the exception of the working directory (.) and the parent directory
 515  515             (..).
 516  516  
 517  517  
 518  518         -b
 519  519         --escape
 520  520  
 521  521             Forces printing of non-printable characters to be in the octal \ddd
 522  522             notation.
 523  523  
 524  524  
 525  525         -B
 526  526         --ignore-backups
 527  527  
 528  528             Do not display any files ending with a tilde (~).
 529  529  
 530  530  
 531  531         -c
 532  532  
 533  533             Uses time of last modification of the i-node (file created, mode
 534  534             changed, and so forth) for sorting (-t) or printing (-l or -n).
 535  535  
 536  536  
 537  537         -C
 538  538  
 539  539             Multi-column output with entries sorted down the columns. This is
 540  540             the default output format.
 541  541  
 542  542  
 543  543         -d
 544  544  
 545  545             If an argument is a directory, lists only its name (not its
 546  546             contents). Often used with -l to get the status of a directory.
 547  547  
 548  548  
 549  549         -e
 550  550  
 551  551             The same as -l, except displays time to the second, and with one
 552  552             format for all files regardless of age: mmm dd hh:mm:ss yyyy.
 553  553  
 554  554  
 555  555         -E
 556  556  
 557  557             The same as -l, except displays time to the nanosecond and with one
 558  558             format for all files regardless of age: yyyy-mm-dd
 559  559             hh:mm:ss.nnnnnnnnn (ISO 8601:2000 format).
 560  560  
 561  561             In addition, this option displays the offset from UTC in ISO
 562  562             8601:2000 standard format (+hhmm or -hhmm) or no characters if the
 563  563             offset is indeterminable. The offset reflects the appropriate
 564  564             standard or alternate offset in force at the file's displayed date
 565  565             and time, under the current timezone.
 566  566  
 567  567  
 568  568         -f
 569  569  
 570  570             Forces each argument to be interpreted as a directory and list the
 571  571             name found in each slot. This option turns off -l, -t, -s, -S, and
 572  572             -r, and turns on -a. The order is the order in which entries appear
 573  573             in the directory.
 574  574  
 575  575  
 576  576         -F
 577  577         --classify
 578  578  
 579  579             Append a symbol after certain types of files to indicate the file
 580  580             type. The following symbols are used:
 581  581  
 582  582             /
 583  583  
 584  584                 Directory
 585  585  
 586  586  
 587  587             >
 588  588  
 589  589                 Door file
 590  590  
 591  591  
 592  592             |
 593  593  
 594  594                 Named pipe (FIFO)
 595  595  
 596  596  
 597  597             @
 598  598  
 599  599                 Symbolic link
 600  600  
 601  601  
 602  602             =
 603  603  
 604  604                 Socket
 605  605  
 606  606  
 607  607             *
 608  608  
 609  609                 Executable
 610  610  
 611  611  
 612  612  
 613  613         -g
 614  614  
 615  615             The same as -l, except that the owner is not printed.
 616  616  
 617  617  
 618  618         -h
 619  619         --human-readable
 620  620  
 621  621             All sizes are scaled to a human readable format, for example, 14K,
 622  622             234M, 2.7G, or 3.0T. Scaling is done by repetitively dividing by
 623  623             1024. The last --si or -h option determines the divisor used.
 624  624  
 625  625  
 626  626         -H
 627  627         --dereference-command-line
 628  628  
 629  629             If an argument is a symbolic link that references a directory, this
 630  630             option evaluates the file information and file type of the
 631  631             directory that the link references, rather than those of the link
 632  632             itself. However, the name of the link is displayed, rather than the
 633  633             referenced directory.
 634  634  
 635  635  
 636  636         -i
 637  637         --inode
 638  638  
 639  639             For each file, prints the i-node number in the first column of the
 640  640             report.
 641  641  
 642  642  
 643  643         -k
 644  644  
 645  645             All sizes are printed in kbytes. Equivalent to --block-size=1024.
 646  646  
 647  647  
 648  648         -l
 649  649  
 650  650             Lists in long format, giving mode, ACL indication, number of links,
 651  651             owner, group, size in bytes, and time of last modification for each
 652  652             file (see above). If the file is a special file, the size field
 653  653             instead contains the major and minor device numbers. If the time of
 654  654             last modification is greater than six months ago, it is shown in
 655  655             the format `month date year' for the POSIX locale. When the LC_TIME
 656  656             locale category is not set to the POSIX locale, a different format
 657  657             of the time field can be used. Files modified within six months
 658  658             show `month date time'. If the file is a symbolic link, the
 659  659             filename is printed followed by "->" and the path name of the
 660  660             referenced file.
 661  661  
 662  662  
 663  663         -L
 664  664         --dereference
 665  665  
 666  666             If an argument is a symbolic link, this option evaluates the file
 667  667             information and file type of the file or directory that the link
 668  668             references, rather than those of the link itself. However, the name
 669  669             of the link is displayed, rather than the referenced file or
 670  670             directory.
 671  671  
 672  672  
  
    | 
      ↓ open down ↓ | 
    672 lines elided | 
    
      ↑ open up ↑ | 
  
 673  673         -m
 674  674  
 675  675             Streams output format. Files are listed across the page, separated
 676  676             by commas.
 677  677  
 678  678  
 679  679         -n
 680  680         --numeric-uid-gid
 681  681  
 682  682             The same as -l, except that the owner's UID and group's GID numbers
 683      -           are printed, rather than the associated character strings.
      683 +           are printed, rather than the associated character strings. Files
      684 +           for which owner and/or group is a Windows Security Identifier
      685 +           (SID), -n suppresses any lookups for the Windows Name string and
      686 +           prints only the raw SID.  Moreover, a second instance of this flag
      687 +           (-nn) can be used to further suppress idmapd(1M) lookups of the
      688 +           file's owner and/or group SID, thus forcing ls into printing the
      689 +           raw ephemeral numeric identifiers.
 684  690  
 685  691  
 686  692         -o
 687  693         --no-group
 688  694  
 689  695             The same as -l, except that the group is not printed.
 690  696  
 691  697  
 692  698         -p
 693  699  
 694  700             Puts a slash (/) after each filename if the file is a directory.
 695  701  
 696  702  
 697  703         -q
 698  704         --hide-control-chars
 699  705  
 700  706             Forces printing of non-printable characters in file names as the
 701  707             character question mark (?).
 702  708  
 703  709  
 704  710         -r
 705  711         --reverse
 706  712  
 707  713             Reverses the order of sort to get reverse alphabetic, oldest first,
 708  714             or smallest file size first as appropriate.
 709  715  
 710  716  
 711  717         -R
 712  718         --recursive
 713  719  
 714  720             Recursively lists subdirectories encountered.
 715  721  
 716  722  
 717  723         -s
 718  724         --size
 719  725  
 720  726             Indicate the total number of file system blocks consumed by each
 721  727             file displayed.
 722  728  
 723  729  
 724  730         -S
 725  731  
 726  732             Sort by file size (in decreasing order) and for files with the same
 727  733             size by file name (in increasing alphabetic order) instead of just
 728  734             by name.
 729  735  
 730  736  
 731  737         -t
 732  738  
 733  739             Sorts by time stamp (latest first) instead of by name. The default
 734  740             is the last modification time. See -c, -u and -%.
 735  741  
 736  742  
 737  743         -u
 738  744  
 739  745             Uses time of last access instead of last modification for sorting
 740  746             (with the -t option) or printing (with the -l option).
 741  747  
 742  748  
 743  749         -U
 744  750  
 745  751             Output is unsorted.
 746  752  
 747  753  
 748  754         -v
 749  755  
 750  756             The same as -l, except that verbose ACL information is displayed as
 751  757             well as the -l output. ACL information is displayed even if the
 752  758             file or directory doesn't have an ACL.
 753  759  
 754  760  
 755  761         -V
 756  762  
 757  763             The same as -l, except that compact ACL information is displayed
 758  764             after the -l output.
 759  765  
 760  766             The -V option is only applicable to file systems that support NFSv4
 761  767             ACLs, such as the Solaris ZFS file system.
 762  768  
 763  769             The format of the displayed ACL is as follows:
 764  770  
 765  771               entry_type : permissions : inheritance_flags : access_type
 766  772  
 767  773  
 768  774             entry_type is displayed as one of the following:
 769  775  
 770  776             user:username
 771  777  
 772  778                 Additional user access for username.
 773  779  
 774  780  
 775  781             group:groupname
 776  782  
 777  783                 Additional group access for group groupname.
 778  784  
 779  785  
 780  786             owner@
 781  787  
 782  788                 File owner.
 783  789  
 784  790  
 785  791             group@
 786  792  
 787  793                 File group owner.
 788  794  
 789  795  
 790  796             everyone@
 791  797  
 792  798                 Everyone access, including file owner and file group owner.
 793  799                 This is not equivalent to the POSIX other class.
 794  800  
 795  801             The following permissions, supported by the NFSv4 ACL model, are
 796  802             displayed by using the -v or -V options:
 797  803  
 798  804             read_data (r)
 799  805  
 800  806                 Permission to read the data of a file.
 801  807  
 802  808  
 803  809             list_directory (r)
 804  810  
 805  811                 Permission to list the contents of a directory.
 806  812  
 807  813  
 808  814             write_data (w)
 809  815  
 810  816                 Permission to modify a file's data. anywhere in the file's
 811  817                 offset range.
 812  818  
 813  819  
 814  820             add_file (w)
 815  821  
 816  822                 Permission to add a new file to a directory.
 817  823  
 818  824  
 819  825             append_data (p)
 820  826  
 821  827                 The ability to modify a file's data, but only starting at EOF.
 822  828  
 823  829  
 824  830             add_subdirectory (p)
 825  831  
 826  832                 Permission to create a subdirectory to a directory.
 827  833  
 828  834  
 829  835             read_xattr (R)
 830  836  
 831  837                 Ability to read the extended attributes of a file.
 832  838  
 833  839  
 834  840             write_xattr (W)
 835  841  
 836  842                 Ability to create extended attributes or write to the extended
 837  843                 attribute directory.
 838  844  
 839  845  
 840  846             execute (x)
 841  847  
 842  848                 Permission to execute a file.
 843  849  
 844  850  
 845  851             read_attributes (a)
 846  852  
 847  853                 The ability to read basic attributes (non-ACLs) of a file.
 848  854  
 849  855  
 850  856             write_attributes (A)
 851  857  
 852  858                 Permission to change the times associated with a file or
 853  859                 directory to an arbitrary value.
 854  860  
 855  861  
 856  862             delete (d)
 857  863  
 858  864                 Permission to delete a file.
 859  865  
 860  866  
 861  867             delete_child (D)
 862  868  
 863  869                 Permission to delete a file within a directory.
 864  870  
 865  871  
 866  872             read_acl (c)
 867  873  
 868  874                 Permission to read the ACL of a file.
 869  875  
 870  876  
 871  877             write_acl (C)
 872  878  
 873  879                 Permission to write the ACL of a file.
 874  880  
 875  881  
 876  882             write_owner (o)
 877  883  
 878  884                 Permission to change the owner of a file.
 879  885  
 880  886  
 881  887             synchronize (s)
 882  888  
 883  889                 Permission to access file locally at server with synchronize
 884  890                 reads and writes.
 885  891  
 886  892  
 887  893             -
 888  894  
 889  895                 No permission granted
 890  896  
 891  897             The following inheritance flags, supported by the NFSv4 ACL model,
 892  898             are displayed by using the -v or -V options:
 893  899  
 894  900             file_inherit (f)
 895  901  
 896  902                 Inherit to all newly created files.
 897  903  
 898  904  
 899  905             dir_inherit (d)
 900  906  
 901  907                 Inherit to all newly created directories.
 902  908  
 903  909  
 904  910             inherit_only (i)
 905  911  
 906  912                 When placed on a directory, do not apply to the directory, only
 907  913                 to newly created files and directories. This flag requires that
 908  914                 either file_inherit and or dir_inherit is also specified.
 909  915  
 910  916  
 911  917             no_propagate (n)
 912  918  
 913  919                 Indicates that ACL entries should be inherited to objects in a
 914  920                 directory, but inheritance should stop after descending one
 915  921                 level. This flag is dependent upon either file_inherit and or
 916  922                 dir_inherit also being specified.
 917  923  
 918  924  
 919  925             successful_access (S)
 920  926  
 921  927                 Indicates whether an alarm or audit record should be initiated
 922  928                 upon successful accesses. Used with audit/alarm ACE types.
 923  929  
 924  930  
 925  931             failed_access (F)
 926  932  
 927  933                 Indicates whether an alarm or audit record should be initiated
 928  934                 when access fails. Used with audit/alarm ACE types.
 929  935  
 930  936  
 931  937             inherited (I)
 932  938  
 933  939                 ACE was inherited.
 934  940  
 935  941  
 936  942             -
 937  943  
 938  944                 No permission granted.
 939  945  
 940  946             access_type is displayed as one of the following types:
 941  947  
 942  948             alarm
 943  949                      Permission field that specifies permissions that should
 944  950                      trigger an alarm.
 945  951  
 946  952  
 947  953             allow
 948  954                      Permission field that specifies allow permissions.
 949  955  
 950  956  
 951  957             audit
 952  958                      Permission field that specifies permissions that should be
 953  959                      audited.
 954  960  
 955  961  
 956  962             deny
 957  963                      Permission field that specifies deny permissions.
 958  964  
 959  965             For example:
 960  966  
 961  967               $ ls -dV /sandbox/dir.1
 962  968                 drwxr-xr-x+  2 root     root           2 Jan 17 15:09 dir.1
 963  969                                 user:marks:r-------------:fd-----:allow
 964  970                                     owner@:--------------:-------:deny
 965  971                                     owner@:rwxp---A-W-Co-:-------:allow
 966  972                                     group@:-w-p----------:-------:deny
 967  973                                     group@:r-x-----------:-------:allow
 968  974                                  everyone@:-w-p---A-W-Co-:-------:deny
 969  975                                  everyone@:r-x---a-R-c--s:-------:allow
 970  976               $
 971  977                                          ||||||||||||||||:||||||+ inherited access
 972  978                                            ||||||||||||||:||||||+ failed access
 973  979                                            ||||||||||||||:|||||+--success access
 974  980                                            ||||||||||||||:||||+-- no propagate
 975  981                                            ||||||||||||||:|||+--- inherit only
 976  982                                            ||||||||||||||:||+---- directory inherit
 977  983                                            ||||||||||||||:|+----- file inherit
 978  984                                            ||||||||||||||
 979  985                                            ||||||||||||||+ sync
 980  986                                            |||||||||||||+- change owner
 981  987                                            ||||||||||||+-- write ACL
 982  988                                            |||||||||||+--- read ACL
 983  989                                            ||||||||||+---- write extended attributes
 984  990                                            |||||||||+----- read extended attributes
 985  991                                            ||||||||+------ write attributes
 986  992                                            |||||||+------- read attributes
 987  993                                            ||||||+-------- delete child
 988  994                                            |||||+--------- delete
 989  995                                            ||||+---------- append
 990  996                                            |||+----------- execute
 991  997                                            ||+------------ write data
 992  998                                            |+------------- read data
 993  999  
 994 1000  
 995 1001  
 996 1002  
 997 1003         -w cols
 998 1004         --width cols
 999 1005  
1000 1006             Multi-column output where the column width is forced to cols.
1001 1007  
1002 1008  
1003 1009         -x
1004 1010  
1005 1011             Multi-column output with entries sorted across rather than down the
1006 1012             page.
1007 1013  
1008 1014  
1009 1015         -1
1010 1016  
1011 1017             Prints one entry per line of output.
1012 1018  
1013 1019  
1014 1020         -@
1015 1021  
1016 1022             The same as -l, except that extended attribute information
1017 1023             overrides ACL information. An @ is displayed after the file
1018 1024             permission bits for files that have extended attributes.
1019 1025  
1020 1026  
1021 1027         -/ c | v
1022 1028  
1023 1029             The same as -l, and in addition displays the extended system
1024 1030             attributes associated with the file when extended system attributes
1025 1031             are fully supported by the underlying file system. The option -/
1026 1032             supports two option arguments c (compact mode) and v (verbose
1027 1033             mode).
1028 1034  
1029 1035             appendonly
1030 1036  
1031 1037                 Allows a file to be modified only at offset EOF. Attempts to
1032 1038                 modify a file at a location other than EOF fails with EPERM.
1033 1039  
1034 1040  
1035 1041             archive
1036 1042  
1037 1043                 Indicates if a file has been modified since it was last backed
1038 1044                 up. Whenever the modification time (mtime) of a file is changed
1039 1045                 the archive attribute is set.
1040 1046  
1041 1047  
1042 1048             av_modified
1043 1049  
1044 1050                 ZFS sets the anti-virus attribute which whenever a file's
1045 1051                 content or size changes or when the file is renamed.
1046 1052  
1047 1053  
1048 1054             av_quarantined
1049 1055  
1050 1056                 Anti-virus software sets to mark a file as quarantined.
1051 1057  
1052 1058  
1053 1059             crtime
1054 1060  
1055 1061                 Timestamp when a file is created.
1056 1062  
1057 1063  
1058 1064             hidden
1059 1065  
1060 1066                 Marks a file as hidden.
1061 1067  
1062 1068  
1063 1069             immutable
1064 1070  
1065 1071                 Prevents the content of a file from being modified. Also
1066 1072                 prevents all metadata changes, except for access time updates.
1067 1073                 When placed on a directory, prevents the deletion and creation
1068 1074                 of files in the directories. Attempts to modify the content of
1069 1075                 a file or directory marked as immutable fail with EPERM.
1070 1076                 Attempts to modify any attributes (with the exception of access
1071 1077                 time and, with the proper privileges, the immutable) of a file
1072 1078                 marked as immutable fails with EPERM.
1073 1079  
1074 1080  
1075 1081             nodump
1076 1082  
1077 1083                 Solaris systems have no special semantics for this attribute.
1078 1084  
1079 1085  
1080 1086             nounlink
1081 1087  
1082 1088                 Prevents a file from being deleted. On a directory, the
1083 1089                 attribute also prevents any changes to the contents of the
1084 1090                 directory. That is, no files within the directory can be
1085 1091                 removed or renamed. The errno EPERM is returned when attempting
1086 1092                 to unlink or rename files and directories that are marked as
1087 1093                 nounlink.
1088 1094  
1089 1095  
1090 1096             offline
1091 1097  
1092 1098                 Indicate that a file is offline.  Solaris systems have no
1093 1099                 special semantics for this attribute.
1094 1100  
1095 1101  
1096 1102             readonly
1097 1103  
1098 1104                 Marks a file as readonly. Once a file is marked as readonly the
1099 1105                 content data of the file cannot be modified. Other metadata for
1100 1106                 the file can still be modified.
1101 1107  
1102 1108  
1103 1109             sparse
1104 1110  
1105 1111                 Indicate that a file can be interpreted as sparse.  It does not
1106 1112                 indicate that the file is actually sparse or not.  The sparse
1107 1113                 attribute is cleared when the file is truncated to zero length.
1108 1114                 Solaris systems have no other special semantics for this
1109 1115                 attribute.
1110 1116  
1111 1117  
1112 1118             system
1113 1119  
1114 1120                 Solaris systems have no special semantics for this attribute.
1115 1121  
1116 1122  
1117 1123  
1118 1124  
1119 1125         The display characters used in compact mode (-/ c) are as follows:
1120 1126  
1121 1127           Attribute Name     Display
1122 1128           archive            A
1123 1129           hidden             H
1124 1130           readonly           R
1125 1131           system             S
1126 1132           appendonly         a
1127 1133           nodump             d
1128 1134           immutable          i
1129 1135           av_modified        m
1130 1136           av_quarantined     q
1131 1137           nounlink           u
1132 1138           offline            O
1133 1139           sparse             s
1134 1140  
1135 1141  
1136 1142  
1137 1143  
1138 1144         The display in verbose mode (-/ v) uses full attribute names when it is
1139 1145         set and the name prefixed by 'no' when it is not set.
1140 1146  
1141 1147  
1142 1148         The attribute name crtime and all other timestamps are handled by the
1143 1149         option -% with the respective timestamp option arguments and also with
1144 1150         all option argument. The display positions are as follows: The display
1145 1151         in verbose mode (-/ v) uses full attribute names  when it is set and
1146 1152         the name prefixed by no when it is not set. The attribute name crtime
1147 1153         and all other timestamps are handled by the option -% with the
1148 1154         respective timestamp option arguments and also with all option
1149 1155         argument.
1150 1156  
1151 1157  
1152 1158         The display positions are as follows:
1153 1159  
1154 1160           {||||||||||||}
1155 1161            |||||||||||+- s (sparse)
1156 1162            ||||||||||+-- O (offline)
1157 1163            |||||||||+--- u (nounlink)
1158 1164            ||||||||+---- q (av_quarantined)
1159 1165            |||||||+----- m (av_modified)
1160 1166            ||||||+------ i (immutable)
1161 1167            |||||+------- d (nodump)
1162 1168            ||||+-------- a (appendonly)
1163 1169            |||+--------- S (system)
1164 1170            ||+---------- R (readonly)
1165 1171            |+----------- H (hidden)
1166 1172            +------------ A (archive)
1167 1173  
1168 1174  
1169 1175  
1170 1176           -% atime | crtime | ctime | mtime | all
1171 1177  
1172 1178  
1173 1179  
1174 1180         atime
1175 1181  
1176 1182             Equivalent to -u.
1177 1183  
1178 1184  
1179 1185         crtime
1180 1186  
1181 1187             Uses the creation time of the file for sorting or printing.
1182 1188  
1183 1189  
1184 1190         ctime
1185 1191  
1186 1192             Equivalent to -c.
1187 1193  
1188 1194  
1189 1195         mtime
1190 1196  
1191 1197             Uses the last modification time of the file contents for sorting or
1192 1198             printing.
1193 1199  
1194 1200  
1195 1201  
1196 1202         If extended system attributes are not supported or if the user does not
1197 1203         have read permission on the file or if the crtime extended attribute is
1198 1204         not set, crtime is treated as a synonym for mtime.
1199 1205  
1200 1206  
1201 1207         When option argument all is specified, all available timestamps are
1202 1208         printed which includes atime, ctime, mtime and on the extended system
1203 1209         attribute supporting file systems, crtime (create time).  The option -%
1204 1210         all does not effect which timestamp is displayed in long format and
1205 1211         does not affect sorting.
1206 1212  
1207 1213         --block-size size
1208 1214  
1209 1215             Display sizes in multiples of size. Size can be scaled by suffixing
1210 1216             one of YyZzEePpTtGgMmKk. Additionally, a B can be placed at the end
1211 1217             to indicate powers of 10 instead of 2. For example, . 10mB means
1212 1218             blocks of 10000000 bytes while 10m means blocks of 10*2^20 --
1213 1219             10485760 -- bytes. This is mutually exclusive with the -h option.
1214 1220  
1215 1221  
1216 1222         --color [=when]
1217 1223         --colour[=when]
1218 1224  
1219 1225             Display filenames using color on color-capable terminals. when is
1220 1226             an optional argument that determines when to display color output.
1221 1227  
1222 1228             Possible values for when are:
1223 1229  
1224 1230             always
1225 1231             yes
1226 1232             force
1227 1233  
1228 1234                 Always use color.
1229 1235  
1230 1236  
1231 1237             auto
1232 1238             tty
1233 1239             if-tty
1234 1240  
1235 1241                 Use color if a terminal is present.
1236 1242  
1237 1243  
1238 1244             no
1239 1245             never
1240 1246             none
1241 1247  
1242 1248                 Never use color. This is the default
1243 1249  
1244 1250             See COLOR OUTPUT for information on how to control the output
1245 1251             colors.
1246 1252  
1247 1253  
1248 1254         --file-type
1249 1255  
1250 1256             Display a suffix after a file depending on it's type, similar to
1251 1257             the -F option, except * is not appended to executable files.
1252 1258  
1253 1259  
1254 1260         -si
1255 1261         --
1256 1262  
1257 1263             Display human scaled sizes similar to the -h option, except values
1258 1264             are repeatedly divided by 1000 instead of 1024. The last option
1259 1265             --si or -h determines the divisor used.
1260 1266  
1261 1267  
1262 1268         --time-style style
1263 1269  
1264 1270             Display times using the specified style. This does not effect the
1265 1271             times displayed for extended attributes (-%).
1266 1272  
1267 1273             Possible values for style are:
1268 1274  
1269 1275             full-iso
1270 1276  
1271 1277                 Equivalent to -E.
1272 1278  
1273 1279  
1274 1280             long-iso
1275 1281  
1276 1282                 Display in YYYY-MM-DD HH:MM for all files.
1277 1283  
1278 1284  
1279 1285             iso
1280 1286  
1281 1287                 Display older files using YYYY-MM-DD and newer files with MM-DD
1282 1288                 HH:MM.
1283 1289  
1284 1290  
1285 1291             locale
1286 1292  
1287 1293                 Use the default locale format for old and new files. This is
1288 1294                 the default.
1289 1295  
1290 1296  
1291 1297             +FORMAT
1292 1298  
1293 1299                 Use a custom format. Values are the same as described in
1294 1300                 strftime(3C). If a NEWLINE appears in the string, the first
1295 1301                 line is used for older files and the second line is used for
1296 1302                 newer files. Otherwise, the given format is used for all files.
1297 1303  
1298 1304  
1299 1305  
1300 1306     /usr/bin/ls
1301 1307         -F
1302 1308  
1303 1309             Marks directories with a trailing slash (/), doors with a trailing
1304 1310             greater-than sign (>), executable files with a trailing asterisk
1305 1311             (*), FIFOs with a trailing vertical bar (|), symbolic links with a
1306 1312             trailing "at" sign (@), and AF_UNIX address family sockets with a
1307 1313             trailing equals sign (=). Follows symlinks named as operands.
1308 1314  
1309 1315  
1310 1316         --file-type
1311 1317  
1312 1318             Marks entries as with -F with the exception of executable files.
1313 1319             Executable files are not marked. Follows symlinks named as
1314 1320             operands.
1315 1321  
1316 1322  
1317 1323  
1318 1324         Specifying more than one of the options in the following mutually
1319 1325         exclusive pairs is not considered an error: -C and -l (ell), -m and -l
1320 1326         (ell), -x and -l (ell), -@ and -l (ell). The -l option overrides the
1321 1327         other option specified in each pair.
1322 1328  
1323 1329  
1324 1330         Specifying more than one of the options in the following mutually
1325 1331         exclusive groups is not considered an error: -C and -1 (one), -H and
1326 1332         -L, -c and -u, and -e and -E, and -t and -S. The last option specifying
1327 1333         a specific timestamp (-c, -u, -% atime , -% crtime, -% ctime, and -%
1328 1334         mtime) determines the timestamps used for sorting or in long format
1329 1335         listings. The last option -t, -S, or -U determines the sorting
1330 1336         behavior.
1331 1337  
1332 1338     /usr/xpg4/bin/ls
1333 1339         -F
1334 1340  
1335 1341             Marks directories with a trailing slash (/), doors with a trailing
1336 1342             greater-than sign (>), executable files with a trailing asterisk
1337 1343             (*), FIFOs with a trailing vertical bar (|), symbolic links with a
1338 1344             trailing "at" sign (@), and AF_UNIX address family sockets with a
1339 1345             trailing equals sign (=). Follows symlinks named as operands.
1340 1346  
1341 1347  
1342 1348         --file-type
1343 1349  
1344 1350             Marks entries as with -F with the exception of executable files.
1345 1351             Executable files are not marked. Follows symlinks named as
1346 1352             operands.
1347 1353  
1348 1354  
1349 1355  
1350 1356         Specifying more than one of the options in the following groups of
1351 1357         mutually exclusive options is not considered an error: -C and -l (ell),
1352 1358         -m and -l (ell), -x and -l (ell), -@ and -l (ell), -C and -1 (one), -H
1353 1359         and -L, -c and -u, -e and -E, -t and -S and -U. The last option
1354 1360         specifying a specific timestamp (-c, -u, -% atime , -% crtime, -%
1355 1361         ctime, and -% mtime) determines the timestamps used for sorting or in
1356 1362         long format listings. The last -t, -S, or -U option determines the
1357 1363         sorting behavior.
1358 1364  
1359 1365     /usr/xpg6/bin/ls
1360 1366         -F
1361 1367  
1362 1368             Marks directories with a trailing slash (/), doors with a trailing
1363 1369             greater-than sign (>), executable files with a trailing asterisk
1364 1370             (*), FIFOs with a trailing vertical bar (|), symbolic links with a
1365 1371             trailing "at" sign (@), and AF_UNIX address family sockets with a
1366 1372             trailing equals sign (=). Does not follow symlinks named as
1367 1373             operands unless the -H or -L option is specified.
1368 1374  
1369 1375  
1370 1376         --file-type
1371 1377  
1372 1378             Marks entries as with -F with the exception of executable files.
1373 1379             Executable files are not marked. Does not follow symlinks named as
1374 1380             operands unless the -H or -L option is specified.
1375 1381  
1376 1382  
1377 1383  
1378 1384         Specifying more than one of the options in the following mutually
1379 1385         exclusive pairs is not considered an error: -C and -l (ell), m and
1380 1386         -l(ell), -x and -l (ell), -@ and -l (ell), -C and -1 (one), -H and --L,
1381 1387         -c and -u, -e and -E, -t and -S and -U. The last option specifying a
1382 1388         specific timestamp (-c, -u, -% atime , -% crtime, -% ctime, and -%
1383 1389         mtime) determines the timestamps used for sorting or in long format
1384 1390         listings. The last -t, -S, or -U option determines the sorting
1385 1391         behavior.
1386 1392  
1387 1393  OPERANDS
1388 1394         The following operand is supported:
1389 1395  
1390 1396         file
1391 1397  
1392 1398             A path name of a file to be written. If the file specified is not
1393 1399             found, a diagnostic message is output on standard error.
1394 1400  
1395 1401  
1396 1402  USAGE
1397 1403         See largefile(5) for the description of the behavior of ls when
1398 1404         encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
1399 1405  
1400 1406  EXAMPLES
1401 1407         Example 1 Viewing File Permissions
1402 1408  
1403 1409  
1404 1410         The following example shows how to display detailed information about a
1405 1411         file.
1406 1412  
1407 1413  
1408 1414           % ls -l file.1
1409 1415           -rw-r--r--   1 gozer    staff     206663 Mar 14 10:15 file.1
1410 1416  
1411 1417  
1412 1418  
1413 1419  
1414 1420         The permissions string above (-rw-r--r--) describes that the file owner
1415 1421         has read and write permissions, the owning group has read permissions,
1416 1422         and others have read permissions.
1417 1423  
1418 1424  
1419 1425  
1420 1426         The following example shows how to display detailed information about a
1421 1427         directory.
1422 1428  
1423 1429  
1424 1430           % ls -ld test.dir
1425 1431           drwxr-xr-x   2 gozer    staff          2 Mar 14 10:17 test.dir
1426 1432  
1427 1433  
1428 1434  
1429 1435  
1430 1436         The permissions string above (drwxr-xr-x) describes that the directory
1431 1437         owner has read, write, and search permissions, the owning group has
1432 1438         read and search permissions, and others have read and search
1433 1439         permissions.
1434 1440  
1435 1441  
1436 1442  
1437 1443         Another example of listing file permissions is as follows:
1438 1444  
1439 1445  
1440 1446           % ls -l file.2
1441 1447           -rw-rwl---   1 gozer    staff     206663 Mar 14 10:47 file.2
1442 1448  
1443 1449  
1444 1450  
1445 1451  
1446 1452         The permissions string above (-rw-rwl---) describes that the file owner
1447 1453         has read and write permissions, the owning group has read and write
1448 1454         permissions, and the file can be locked during access.
1449 1455  
1450 1456  
1451 1457         Example 2 Displaying ACL Information on Files and Directories
1452 1458  
1453 1459  
1454 1460         The following example shows how to display verbose ACL information on a
1455 1461         ZFS file.
1456 1462  
1457 1463  
1458 1464           % ls -v file.1
1459 1465           -rw-r--r--   1 marks    staff     206663 Mar 14 10:15 file.1
1460 1466                0:owner@:execute:deny
1461 1467                1:owner@:read_data/write_data/append_data/write_xattr/write_attributes
1462 1468                     /write_acl/write_owner:allow
1463 1469                2:group@:write_data/append_data/execute:deny
1464 1470                3:group@:read_data:allow
1465 1471                4:everyone@:write_data/append_data/write_xattr/execute/write_attributes
1466 1472                     /write_acl/write_owner:deny
1467 1473                5:everyone@:read_data/read_xattr/read_attributes/read_acl/synchronize
1468 1474                     :allow
1469 1475  
1470 1476  
1471 1477  
1472 1478  
1473 1479         The following example shows how to display compact ACL information on a
1474 1480         ZFS directory.
1475 1481  
1476 1482  
1477 1483           % ls -dV test.dir
1478 1484           drwxr-xr-x   2 marks    staff          2 Mar 14 10:17 test.dir
1479 1485                       owner@:--------------:------:deny
1480 1486                       owner@:rwxp---A-W-Co-:------:allow
1481 1487                       group@:-w-p----------:------:deny
1482 1488                       group@:r-x-----------:------:allow
1483 1489                       everyone@:-w-p---A-W-Co-:------:deny
1484 1490                       everyone@:r-x---a-R-c--s:------:allow
1485 1491  
1486 1492  
1487 1493  
1488 1494  
1489 1495         The following example illustrates the ls -v behavior when listing ACL
1490 1496         information on a UFS file.
1491 1497  
1492 1498  
1493 1499           $ ls -v file.3
1494 1500           -rw-r--r--   1 root     root        2703 Mar 14 10:59 file.3
1495 1501                0:user::rw-
1496 1502                1:group::r--               #effective:r--
1497 1503                2:mask:r--
1498 1504                3:other:r--
1499 1505  
1500 1506  
1501 1507  
1502 1508         Example 3 Printing the Names of All Files
1503 1509  
1504 1510  
1505 1511         The following example prints the names of all files in the current
1506 1512         directory, including those that begin with a dot (.), which normally do
1507 1513         not print:
1508 1514  
1509 1515  
1510 1516           example% ls -a
1511 1517  
1512 1518  
1513 1519  
1514 1520         Example 4 Providing File Information
1515 1521  
1516 1522  
1517 1523         The following example provides file information:
1518 1524  
1519 1525  
1520 1526           example% ls -aisn
1521 1527  
1522 1528  
1523 1529  
1524 1530  
1525 1531         This command provides information on all files, including those that
1526 1532         begin with a dot (a), the i-number, the memory address of the i-node
1527 1533         associated with the file--printed in the left-hand column (i); the size
1528 1534         (in blocks) of the files, printed in the column to the right of the i-
1529 1535         numbers (s); finally, the report is displayed in the numeric version of
1530 1536         the long list, printing the UID (instead of user name) and GID (instead
1531 1537         of group name) numbers associated with the files.
1532 1538  
1533 1539  
1534 1540  
1535 1541         When the sizes of the files in a directory are listed, a total count of
1536 1542         blocks, including indirect blocks, is printed.
1537 1543  
1538 1544  
1539 1545         Example 5 Providing Extended System Attributes Information
1540 1546  
1541 1547           example% ls -/ c file    (extended system attribute in compact mode)
1542 1548           -rw-r--r--   1 root     root           0 May 10 14:17 file
1543 1549                                    {AHRSadim-u--}
1544 1550  
1545 1551  
1546 1552  
1547 1553  
1548 1554         In this example, av_quarantined, offline, and sparse are not set.
1549 1555  
1550 1556           example% ls -/ v file (extended system attribute in verbose mode)
1551 1557           -rw-r--r--   1 root     root           0 May 10 14:17 file
1552 1558                     {archive,hidden,readonly,system,\
1553 1559                      appendonly,nodump,immutable,av_modified,\
1554 1560                      noav_quarantined,nounlink,nooffline,\
1555 1561                      nosparse}
1556 1562  
1557 1563           example% ls -/ v file     (no extended system attribute)
1558 1564           -rw-r--r--  1 root    staff        0 May 16 14:48 file
1559 1565                          {}
1560 1566  
1561 1567           example% ls -/ c file        (extended system attribute
1562 1568                                         supported file system)
1563 1569  
1564 1570           -rw-r--r--  1 root staff        3 Jun  4 22:04 file
1565 1571                          {A------m----}
1566 1572  
1567 1573  
1568 1574  
1569 1575  
1570 1576         archive and av_modified attributes are set by default on  an extended
1571 1577         system attribute supported file.
1572 1578  
1573 1579           example% ls -/ c  -%crtime file
1574 1580  
1575 1581           -rw-r--r--    root     root          0 May 10 14:17 file
1576 1582                          {AHRSadim-u--}
1577 1583  
1578 1584  
1579 1585  
1580 1586  
1581 1587         This example displays the timestamp as the creation time:
1582 1588  
1583 1589           example% ls -l -%all file
1584 1590           -rw-r--r--   1 root     root           0 May 10 14:17    file
1585 1591                           timestamp: atime    Jun 14 08:47:37 2007
1586 1592                           timestamp: ctime    May 10 14:20:23 2007
1587 1593                           timestamp: mtime    May 10 14:17:56 2007
1588 1594                           timestamp: crtime   May 10 14:17:56 2007
1589 1595  
1590 1596           example% ls -%crtime -tl file*
1591 1597  
1592 1598           -rw-r--r--   1 foo      staff          3 Jun  4 22:04 file1
1593 1599           -rw-r--r--   1 root     root           0 May 10 14:17 file
1594 1600           -rw-r--r--   1 foo      staff          0 May  9 13:49 file.1
1595 1601  
1596 1602  
1597 1603  
1598 1604  
1599 1605         In this example the files are sorted by creation time.
1600 1606  
1601 1607  ENVIRONMENT VARIABLES
1602 1608         See environ(5) for descriptions of the following environment variables
1603 1609         that affect the execution of ls: LANG, LC_ALL, LC_COLLATE, LC_CTYPE,
1604 1610         LC_TIME, LC_MESSAGES, NLSPATH, and TZ.
1605 1611  
1606 1612         COLUMNS
1607 1613  
1608 1614             Determines the user's preferred column position width for writing
1609 1615             multiple text-column output. If this variable contains a string
1610 1616             representing a decimal integer, the ls utility calculates how many
1611 1617             path name text columns to write (see -C) based on the width
1612 1618             provided. If COLUMNS is not set or is invalid, 80 is used. The
1613 1619             column width chosen to write the names of files in any given
1614 1620             directory is constant. File names are not be truncated to fit into
1615 1621             the multiple text-column output.
1616 1622  
1617 1623  
1618 1624         LS_COLORS
1619 1625  
1620 1626             Determines the coloring scheme used when displaying color output.
1621 1627             If not set and color output is specified, a default scheme is used.
1622 1628             If TERM is not set, no color output is used.
1623 1629  
1624 1630  
1625 1631         TERM
1626 1632  
1627 1633             Determine the terminal type. If this variable is unset or NULL, no
1628 1634             color output is generated regardless of the value of the --color
1629 1635             option.
1630 1636  
1631 1637  
1632 1638  EXIT STATUS
1633 1639         0
1634 1640               All information was written successfully.
1635 1641  
1636 1642  
1637 1643         >0
1638 1644               An error occurred.
1639 1645  
1640 1646  
1641 1647  FILES
1642 1648         /etc/group
1643 1649  
1644 1650             group IDs for ls -l and ls -g
1645 1651  
1646 1652  
1647 1653         /etc/passwd
1648 1654  
1649 1655             user IDs for ls -l and ls -o
1650 1656  
1651 1657  
1652 1658         /usr/share/lib/terminfo/?/*
1653 1659  
1654 1660             terminal information database
1655 1661  
1656 1662  
1657 1663  ATTRIBUTES
1658 1664         See attributes(5) for descriptions of the following attributes:
1659 1665  
1660 1666     /usr/bin/ls
1661 1667  
1662 1668         +--------------------+-----------------+
1663 1669         |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
1664 1670         +--------------------+-----------------+
1665 1671         |CSI                 | Enabled         |
1666 1672         +--------------------+-----------------+
1667 1673         |Interface Stability | Committed       |
1668 1674         +--------------------+-----------------+
1669 1675         |Standard            | See below.      |
1670 1676         +--------------------+-----------------+
1671 1677  
1672 1678  
1673 1679         For all options except -A, -b, -e, -E, -h, -S, U -v, -V, -@, -/, -%,
1674 1680         --all, --almost-all, --block-size, --classify, --color, --colour,
1675 1681         --dereference, --dereference-command-line, --escape, --file-type,
1676 1682         --full-time, --human-readable, --ignore-backups, --inode, --no-group,
1677 1683         --numeric-uid-gid, --reverse, --recursive, --si, --size, and --time-
1678 1684         style, see standards(5).
1679 1685  
1680 1686     /usr/xpg4/bin/ls
1681 1687  
1682 1688         +--------------------+-----------------+
1683 1689         |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
1684 1690         +--------------------+-----------------+
1685 1691         |CSI                 | Enabled         |
1686 1692         +--------------------+-----------------+
1687 1693         |Interface Stability | Committed       |
1688 1694         +--------------------+-----------------+
1689 1695         |Standard            | See below.      |
1690 1696         +--------------------+-----------------+
1691 1697  
1692 1698  
1693 1699         For all options except -A, -b, -e, -E, -h, -S, U -v, -V, -@, -/, -%,
1694 1700         --all, --almost-all, --block-size, --classify, --color, --colour,
1695 1701         --dereference, --dereference-command-line, --escape, --file-type,
1696 1702         --full-time, --human-readable, --ignore-backups, --inode, --no-group,
1697 1703         --numeric-uid-gid, --reverse, --recursive, --si, --size, and --time-
1698 1704         style, see standards(5).
1699 1705  
1700 1706     /usr/xpg6/bin/ls
1701 1707  
1702 1708         +--------------------+-----------------+
1703 1709         |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
1704 1710         +--------------------+-----------------+
1705 1711         |CSI                 | Enabled         |
1706 1712         +--------------------+-----------------+
1707 1713         |Interface Stability | Committed       |
1708 1714         +--------------------+-----------------+
1709 1715         |Standard            | See below.      |
1710 1716         +--------------------+-----------------+
1711 1717  
1712 1718  
  
    | 
      ↓ open down ↓ | 
    1019 lines elided | 
    
      ↑ open up ↑ | 
  
1713 1719         For all options except -A, -b, -e, -E, -h, -S, U -v, -V, -@, -/, -%,
1714 1720         --all, --almost-all, --block-size, --classify, --color, --colour,
1715 1721         --dereference, --dereference-command-line, --escape, --file-type,
1716 1722         --full-time, --human-readable, --ignore-backups, --inode, --no-group,
1717 1723         --numeric-uid-gid, --reverse, --recursive, --si, --size, and --time-
1718 1724         style, see standards(5).
1719 1725  
1720 1726  SEE ALSO
1721 1727         chmod(1), cp(1), setfacl(1), fgetattr(3C), strftime(3C), terminfo(4),
1722 1728         acl(5), attributes(5), environ(5), fsattr(5), largefile(5),
1723      -       standards(5)
     1729 +       standards(5), idmapd(1M)
1724 1730  
1725 1731  NOTES
1726 1732         Unprintable characters in file names can confuse the columnar output
1727 1733         options.
1728 1734  
1729 1735  
1730 1736         The total block count is incorrect if there are hard links among the
1731 1737         files.
1732 1738  
1733 1739  
1734 1740         The sort order of ls output is affected by the locale and can be
1735 1741         overridden by the LC_COLLATE environment variable. For example, if
1736 1742         LC_COLLATE equals C, dot files appear first, followed by names
1737 1743         beginning with upper-case letters, then followed by names beginning
1738 1744         with lower-case letters. But if LC_COLLATE equals en_US.ISO8859-1, then
1739 1745         leading dots as well as case are ignored in determining the sort order.
1740 1746  
1741 1747  
     1748 +       For additional information regarding Windows Security Identifiers,
     1749 +       consult Microsoft support document, Well-known security identifiers in
     1750 +       Windows operating systems, which can be found at Microsoft's support
     1751 +       site: https://support.microsoft.com/en-us/kb/243330/.
1742 1752  
1743      -                               November 24, 2014                         LS(1)
     1753 +
     1754 +
     1755 +                                 July 1, 2016                            LS(1)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX