home *** CD-ROM | disk | FTP | other *** search
/ ftp.shrubbery.net / 2015-02-07.ftp.shrubbery.net.tar / ftp.shrubbery.net / pub / pc / unix / ls.doc < prev    next >
Text File  |  2002-03-31  |  3KB  |  78 lines

  1. ls    - list contents of directory
  2.  
  3. SYNOPSIS
  4.      ls [ -alrst1R ] name
  5.  
  6. DESCRIPTION
  7.      For each directory argument, ls lists the contents of the
  8.      directory; for each file argument, ls repeats its name and
  9.      any other information requested; for each drive argument, ls
  10.      lists the content of the current directory on that drive.
  11.      By default, the output is sorted alphabetically.
  12.      When no argument is given, the current directory is listed. 
  13.      Directory names are marked with a trailing backslash (\).
  14.  
  15.      There are a large number of options:
  16.  
  17.      -l   List in long format, giving mode, size in bytes,
  18.           and time of last modification for each file.
  19.  
  20.      -t   Sort by time modified (latest first) instead of by name.
  21.  
  22.      -a   List all entries; in the absence of this option, entries
  23.           with the hidden bit set, and entries whose names begin 
  24.           with a period (.) or an underscore (_), are not listed.
  25.  
  26.      -s   Give size in bytes of each file.
  27.  
  28.      -r   Reverse the order of sort to get reverse alphabetic or
  29.           oldest first as appropriate.
  30.  
  31.      -R   recursively list subdirectories encountered.
  32.  
  33.      -1   force one entry per line output format.
  34.  
  35.  
  36.      The mode printed under the -l option contains 6 characters
  37.      which are interpreted as follows: the first character is
  38.  
  39.      d  if the entry is a directory;
  40.      t  if the entry is a temporary file; or
  41.      -  if the entry is a plain file.
  42.  
  43.      The next two characters indicate whether the file has attributes
  44.      unique to MS-DOS, as follows:
  45.  
  46.      h  if the file is hidden (only seen via -a);
  47.      s  if the file is part of the MS-DOS kernel (system); or
  48.      -  if the file is a plain file.
  49.  
  50.      The next three characters indicate permission respectively 
  51.      to read, to write, or to execute the file as a program.  Only
  52.      the write permission bit has any real meaning; the read and
  53.      execute bits are determined by looking at the file extension
  54.      and whether the file is a directory.  For a directory, `execute'
  55.      permission is interpreted to mean permission to search 
  56.      the directory.  The permissions are indicated as follows:
  57.  
  58.      r  if the file is readable;
  59.      w  if the file is writable;
  60.      x  if the file is executable;
  61.      -  if the indicated permission is not granted.
  62.  
  63.  
  64. BUGS
  65.      Newline and tab are considered printing characters in file names.
  66.  
  67.      The output device is assumed to be 80 columns wide.
  68.  
  69.      Multiple arguments are not allowed.
  70.  
  71.      Will crash if asked to list more than about 2000 files.
  72.  
  73.      Uses a bubble sort that is crushingly slow for directories with
  74.      more than 100 entries.
  75.  
  76.      Not listing files whose names start with underscore is really stupid.
  77.  
  78.