Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ls(C) — Xenix 2.3.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chmod(C)

find(C)

l(C)

lc(C)

termcap(C)



     LS(C)                    XENIX System V                     LS(C)



     Name
          ls - Gives information about contents of directories.

     Syntax
          ls [ -ACFRabcdfgilmnopqrstux ] [ names ]

     Description
          For each directory named, ls lists the contents of that
          directory; for each file named, ls repeats its name and any
          other information requested.  By default, the output is
          sorted alphabetically.  When no argument is given, the
          current directory is listed.  When several arguments are
          given, the arguments are first sorted appropriately, but
          file arguments are processed before directories and their
          contents.

          There are three major listing formats.  The default format
          is to list one entry per line, the -C and -x options enable
          multi-column formats, and the -m option enables stream
          output format in which files are listed across the page,
          separated by commas.  In order to determine output format
          for the -C, -x, and -m options, ls uses an environment
          variable, COLUMNS, to determine the number of character
          positions available on one output line.  If this variable is
          not set, the termcap database is used to determine the
          number of columns, based on the environment variable TERM.
          If this information cannot be obtained, 80 columns are
          assumed.

          There are many options:

          -A   List all entries;  entries whose name begin with a
               period (.) are listed.  Does not list current directory
               (.) and directory above (..).

          -a   Lists all entries;  entries whose name begin with a
               period (.) are listed.

          -R   Recursively lists subdirectories encountered.

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

          -C   Multi-column output with entries sorted down the
               columns.

          -x   Multi-column output with entries sorted across rather
               than down the page.

          -m   Stream output format.




     Page 1                                           (printed 8/7/87)





     LS(C)                    XENIX System V                     LS(C)



          -l   Lists in long format, giving mode, number of links,
               owner, group, size in bytes, and time of last
               modification for each file (see below).  If the file is
               a special file, the size field will contain the major
               and minor device numbers, rather than a size.

          -n   The same as -l, except that the owner's UID and group's
               GID numbers are printed, rather than the associated
               character strings.

          -o   The same as -l, except that the group is not printed.

          -g   The same as -l, except that the owner is not printed.

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

          -t   Sorts by time modified (latest first) instead of by
               name.

          -u   Uses time of last access instead of last modification
               for sorting use with the -t option.

          -c   Uses time of last modification of the inode (file
               created, mode changed, etc.) for sorting use with -t
               option.

          -p   Puts a slash (/) after each filename if that file is a
               directory.

          -F   Puts a slash (/) after each filename if that file is a
               directory and puts an asterisk (*) after each filename
               if that file is executable.

          -b   Forces printing of non-graphic characters to be in the
               octal \ddd notation.

          -q   Forces printing of non-graphic characters in file names
               as the character (?).

          -i   For each file, prints the inode number in the first
               column of the report.

          -s   Gives size in blocks, including indirect blocks, for
               each entry.

          -f   Forces each argument to be interpreted as a directory
               and lists the name found in each slot.  This option
               turns off -l, -t, -s, and -r, and turns on -a; the
               order is the order in which entries appear in the
               directory.




     Page 2                                           (printed 8/7/87)





     LS(C)                    XENIX System V                     LS(C)



          The mode printed under the -l option consists of 11
          characters.  The first character is:

          -   If the entry is an ordinary file.

          d   If the entry is a directory.

          b   If the entry is a block special file.

          c   If the entry is a character special file.

          p   If the entry is a named pipe.

          s   If the entry is a semaphore.

          m   If the entry is a shared data (memory) file.

          The next 9 characters are interpreted as 3 sets of 3 bits
          each.  The first set refers to the owner's permissions; the
          next to permissions of others in the user-group of the file;
          and the last to all others.  Within each set, the 3
          characters indicate permission to read, to write, and 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; likewise, the user-execute
          permission character is given as s if the file has set-
          user-ID mode.  The last character of the mode (normally x or
          -) is t if the 1000 (octal) bit of the mode is on; see
          chmod(C) for the meaning of this mode.  The indications of
          set-ID and 1000 bit of the mode are capitalized if the
          corresponding execute permission is not set.

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

     Files
          /etc/passwd
                  Gets user IDs for ls -l and ls -o




     Page 3                                           (printed 8/7/87)





     LS(C)                    XENIX System V                     LS(C)



          /etc/group
                  Gets group IDs for ls -l and ls -g

          /etc/termcap/*
                  Gets terminal information

     See Also
          chmod(C), find(C), l(C), lc(C), termcap(C)

     Notes
          Newline and tab are considered printing characters in
          filenames.

          Unprintable characters in filenames may confuse the columnar
          output options.

          This utility reports sizes in 512 byte blocks.  Systems
          which define a block as 1024 characters, the size of files
          containing 511 or fewer bytes to 1 block.  ls -s interprets
          1 block from a 1024 byte block system as 2 of its own 512
          byte blocks.  Thus a 500 byte file is interpreted as 2
          blocks rather than 1.  Refer to the machine(M) manual page
          for the block size used by your system.
































     Page 4                                           (printed 8/7/87)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026