[0m


LS(1)		    UNIX Programmer's Manual		    LS(1)



[1mNAME
     [0mls - list contents of directory

[1mSYNOPSIS
     ls [0m[ [1m-acdfgilqrstu1ACLFR [0m] name ...

[1mDESCRIPTION
     [0mFor each directory argument, _l_s lists the contents of the
     directory; for each file argument, _l_s 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 is a large number of options:

     [1m-l   [0mList in long format, giving mode, number of links,
	  owner, size in bytes, and time of last modification for
	  each file.  (See below.) If the file is a special file
	  the size field will instead contain the major and minor
	  device numbers.  If the file is a symbolic link the
	  pathname of the linked-to file is printed preceded by
	  ``->''.

     [1m-g   [0mInclude the group ownership of the file in a long out-
	  put.

     [1m-t   [0mSort by time modified (latest first) instead of by
	  name.

     [1m-a   [0mList all entries; in the absence of this option,
	  entries whose names begin with a period ([1m.[0m) are _n_o_t
	  listed.

     [1m-s   [0mGive size in kilobytes of each file.

     [1m-d   [0mIf argument is a directory, list only its name; often
	  used with [1m-l [0mto get the status of a directory.

     [1m-L   [0mIf argument is a symbolic link, list the file or direc-
	  tory the link references rather than the link itself.

     [1m-r   [0mReverse the order of sort to get reverse alphabetic or
	  oldest first as appropriate.

     [1m-u   [0mUse time of last access instead of last modification
	  for sorting (with the [1m-t [0moption) and/or printing (with
	  the [1m-l [0moption).

     [1m-c   [0mUse time of i-node change (file creation, mode change,



Printed 21/11/91    Revision 1.4 of 02/07/90			1






LS(1)		    UNIX Programmer's Manual		    LS(1)



	  etc.) for sorting or printing.

     [1m-i   [0mFor each file, print the i-number in the first column
	  of the report.

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

     [1m-F   [0mcauses names to be marked with one of the following
	  trailing characters: directories - `/', sockets - `=',
	  symbolic links - `@', and executable files - `*'.

     [1m-R   [0mrecursively list subdirectories encountered.

     [1m-1   [0mforce one entry per line output format; this is the
	  default when output is not to a terminal.

     [1m-C   [0mforce multi-column output; this is the default when
	  output is to a terminal.

     [1m-q   [0mforce printing of non-graphic characters in file names
	  as the character `?'; this is the default when output
	  is to a terminal.

     The mode printed under the [1m-l [0moption contains 11 characters
     which are interpreted as follows: the first character is

     [1md	[0mif the entry is a directory;
     [1mb	[0mif the entry is a block-type special file;
     [1mc	[0mif the entry is a character-type special file;
     [1ml	[0mif the entry is a symbolic link;
     [1mp	[0mif the entry is a named pipe;
     [1ms	[0mif the entry is a socket, or
     [1m-	[0mif the entry is a plain file.

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

     [1mr	[0mif the file is readable;
     [1mw	[0mif the file is writable;
     [1mx	[0mif the file is executable;
     [1m-	[0mif the indicated permission is not granted.




Printed 21/11/91    Revision 1.4 of 02/07/90			2






LS(1)		    UNIX Programmer's Manual		    LS(1)



     The group-execute permission character is given as [1ms [0mif the
     file has the set-group-id bit set; likewise the user-execute
     permission character is given as [1ms [0mif the file has the set-
     user-id bit set.

     The last character of the mode (normally `x' or `-') is [1mt [0mif
     the 1000 bit of the mode is on.  See _c_h_m_o_d(1) for the mean-
     ing of this mode.

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

[1mFILES
     [0m/etc/passwd to get user id's for `ls -l'.
     /etc/group to get group id's for `ls -g'.

[1mBUGS
     [0mNewline 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 as ``ls -s'' is much different than
     ``ls -s | lpr''.  On the other hand, not doing this setting
     would make old shell scripts which used _l_s almost certain
     losers.




























Printed 21/11/91    Revision 1.4 of 02/07/90			3



[0m