


      LS(1)                       (bsd 4.1)                       LS(1)



      NAME
           ls - list contents of directories

      SYNTAX
           ls [ -acdfghilmqrstux1CFR ] [ name ] ...

           l [ options ] [ name ] ...

           lx [ options ] [ name ] ...

           lf [ options ] [ name ] ...

           lr [ options ] [ name ] ...

           ll [ options ] [ name ] ...

      DESCRIPTION
           Ls lists the files that are members of the directory name,
           or lists the file name if name is a file.  With no name
           argument, ls lists the files in the working directory.
           Options request more detailed information about the
           characteristics of the named directories or files.
           lx is equivalent to ls -x
           lf is equivalent to ls -F
           lr is equivalent to ls -R
           ll is equivalent to ls -l
           If ll is redirected to a file, such as ll > filelist, it is
           not equivalent to ls -l.  In order to do a long format
           redirected to a file, one should type `ls -lC'.
           l is equivalent to ls -m

           The output is normally sorted alphabetically by name.

           Some Options control the format of the listed names.  In the
           simplest case, filenames are listed in vertically-sorted
           columns.
           a    e    i
           b    f    j
           c    g    k
           d    h    l

           The options are:

           -l   (lowercase "L") List each name in long format, with:
                access mode, number of links, owner, size in bytes,
                time of last modification, and name.

                -rwxrw-rw- 1 bin2756 May 30 15:14 wowzer
                -rw-rw-r-- 1 root304 Jun 14 15:42 yes.1
                -rw-r---w- 1 root593 Jun 14 15:57 zero.1





      Page 1                                          (73 A2 02MT REV1)






      LS(1)                       (bsd 4.1)                       LS(1)



           -t   Sort by time of last modification (latest first)
                instead of by name:

                -rw-r---w- 1 root593 Jun 14 15:57 zero.1
                -rw-rw-r-- 1 root304 Jun 14 15:42 yes.1
                -rwxrw-rw- 1 bin2756 May 30 15:14 wowzer


           -a   Include all names, including the ones which begin with
                a ``.'' or ``..'', which are normally suppressed. -a is
                a default option for the super-user (root).

           -s   Give size in blocks for each entry. A block is 1024
                bytes even though the minimum storage increment is 4096
                bytes:

                total 68
                    4 docsched
                   12 exmanlist
                    4 getnumber
                   16 goodfor

           -d   If argument is a directory, list only its name, not its
                contents (often used with -l to get the status of a
                directory).

           -r   Reverse the order of sort to get reverse alphabetic or
                oldest first, as appropriate.

           -u   Use time of last access, instead of last modification,
                for sorting ( -t ) and/or printing ( -l ).

           -c   Use time of file creation for sorting (-t) and/or
                printing (-l).

           -i   Print file identifier number in the first column of the
                report for each file listed.

           -f   Force each argument to be interpreted as a directory
                and list the name found in each slot.  This option
                turns off -l, -t, -s, and -r, and turns on -a; output
                is sorted in the same way as entries appear in the
                directory.

           -g   Give group ID instead of owner ID in a long listing.

           -m   Force stream output format.

           -1   (digit "one") Force one entry per line output format,
                e.g., to a teletype.

           -C   Force multi-column output (e.g., to a file).



      Page 2                                          (73 A2 02MT REV1)






      LS(1)                       (bsd 4.1)                       LS(1)



           -q   Force printing of non-graphic characters in file names
                as the character ``?''; this normally happens only if
                the output device is a terminal.

           -h   Force printing of non-graphic characters to be in the
                \ddd notation, in octal.

           -x   Force columnar printing to be sorted across, rather
                than down ,the page; this is the default if the last
                character of the name by which the program is invoked
                is an ``x''.

           -F   Cause directories to be marked with a trailing ``/'',
                and executable files to be marked with a trailing '*'.
                This is the default if the last character of the name
                by which the program is invoked is an ``f''.

           -R   Recursively list subdirectories encountered.

           The mode printed under the -l option consists of 11
           characters that are interpreted as follows:

                The first character is:

                     d   if the entry is a directory;
                     b   if the entry is a block-type special file;
                     c   if the entry is a character-type special file;
                     -   if the entry is an ordinary file.

                The next 9 characters are interpreted as three sets of
                three bits each.  The first set refers to the owner's
                permissions; the next refers to permissions of others
                in the user-group of the file; and the last refers to
                all others.  Within each set, the three characters
                indicate permission to read, to write, or to execute
                the file as a program, respectively.  For a directory,
                ``execute'' permission is interpreted to mean
                permission to search the directory for a specified
                file.

                The permissions are indicated as follows:

                     r   if the file is readable;
                     w   if the file is writable;
                     x   if the file is executable;
                     -   if the indicated permission is not granted.

                The group-execute permission character is given as s if
                the file has set-group-ID mode; similarly, the user-
                execute permission character is given as s if the file
                has set-user-ID mode.  If the group- or user-execute
                character is s, the group- or user-execute character



      Page 3                                          (73 A2 02MT REV1)






      LS(1)                       (bsd 4.1)                       LS(1)



                may or may not be set for execution.  In other words,
                the s obscures the underlying execute character, which
                may be x or -.

                When the sizes of the files in a directory are listed a
                total count of blocks is printed.

      FILES
           /etc/passwd
                   to get user IDs for  ls -l.
           /etc/group
                   to get group IDs for  ls -g.

      SEE ALSO
           chmod(1).

      BUGS
           Newline and tab are considered printing characters in file
           names.

           The output device is assumed to be 80 columns wide.

           The option setting based on whether the output is a teletype
           is undesirable since ``ls -s'' is considerably different
           from ls -s | lpr. On the other hand, not using this setting
           would almost certainly be detrimental to old shell scripts
           that use ``ls''.

           Column widths are not good choices for terminals that can
           tab.

























      Page 4                                          (73 A2 02MT REV1)



