home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / ntcode / ls_nt13 / ls.man < prev    next >
Encoding:
Text File  |  1995-05-19  |  6.7 KB  |  151 lines

  1. LS(1)                   USER COMMANDS                     LS(1)
  2.  
  3. NAME
  4.      ls - list the contents of a directory.               [Version 1.3]
  5.  
  6. SYNOPSIS
  7.      ls [-aAcCdDFgGhIlLRrtuz1] file1 file2 ...
  8.  
  9. DESCRIPTION
  10.      ls is a command similar to DIR, but gives additional information
  11.      about files and directories such as owner, group and permissions
  12.      associated with files and directories.
  13.  
  14.      The -l option shows information in "long format" where each line
  15.      corresponds to one file. Output is divided into several fields:
  16.      the permissions field, the file's owner, group, size, modification
  17.      date and name:
  18.  
  19.     -rwxdr-x----- tomas      Users      43008 Aug 02 17:43 ls.exe
  20.     
  21.      In addition, it is possible to add two more fields: the attribute field
  22.      (-z option) and DOS short file name (-D option).
  23.  
  24.   Permissions Field
  25.      The permissions field, which is printed with the -l option on NTFS
  26.      file systems, should be interpreted as follows:
  27.  
  28.      The first character shows the file type:
  29.           d = entry is a directory
  30.       t = entry is a temporary file
  31.           s = entry is a system file
  32.           a = entry is an atomic-write file
  33.           x = entry is an xaction write file
  34.           - = entry is a plain file
  35.  
  36.      The next 12 characters should be interpreted as three sets of four(!)
  37.      characters each. The first set refers to the owner's permissions; 
  38.      the next set shows access rights explicitly granted to other users
  39.      or groups; the last set refers to permissions for everyone else using
  40.      the system. Within each set, the 4 fields indicate permission to read;
  41.      to write; to execute the file as a program and to delete it (rwxd).
  42.      
  43.      It was necessary to extend the Unix "ls" output format slightly since
  44.      NT interprets access-rights differently, i.e. an explicit delete
  45.      right can be assigned a file.
  46.      
  47.      The four letter positions in each set should be interpreted as follows
  48.      (in general, an upper-case letter denotes permission granted but with
  49.      some limitation):
  50.     -------
  51.     1 | r  file is readable/directory is listable
  52.     -------
  53.       | w  write allowed, no restrictions
  54.       | W  write allowed but not append on files / directory allows file
  55.       |     creation only (no subdirs)
  56.     2 | a  only append allowed / directory allows subdir creation only
  57.       | *  the file is not writable, but ownership or protection
  58.       |      can be changed (this is a warning)
  59.       | =  the file is writable according to the access lists, but the
  60.       |     read-only attribute prevents writing (see the ATTRIB command)
  61.     -------
  62.     3 | x  file is executable/directory is traversable
  63.     -------
  64.       | d  delete is granted for this file or directory as well as for
  65.     4 |      all subdirectories
  66.       | D  delete is granted but not for subdirectories
  67.       | c  delete is granted only for subdirectories
  68.     -------
  69.  
  70.        The following two letters may also appear:
  71.       -  the indicated permission is not granted
  72.       ?  the indicated permission is not known by ls (may occur only
  73.            when negative access rights are present)
  74.        
  75.   Attribute Field
  76.      The attribute field replaces the permissions field on FAT file systems
  77.      or is printed when the user specifies the -z option. It contains 7
  78.      characters and should be interpreted as:
  79.       d = entry is a directory
  80.       s = entry is a system file
  81.       r = entry is read-only (see the ATTRIB command)
  82.       h = entry is hidden (ls needs -a option to show it in listing)
  83.       a = entry has the archive bit set
  84.       T = entry is a temporary file
  85.       A or X = entry is an atomic write (A) or xaction write (X) file
  86.  
  87.   The owner and group fields
  88.       The owner field shows the owner of the file. The group field shows
  89.       *all* users and groups who are explicitly granted permission to do
  90.       something with the file or directory. Note that this interpretation
  91.       differs from the POSIX interpretation (POSIX groups are ignored by NT).
  92.       For example, if user A has permission to read a file (r), and user
  93.       B has permission to write (w), the group permission field will show
  94.       "rw--" and the group field "A,B".
  95.       
  96.       Thus, group permissions should be interpreted as a super-set of all
  97.       access rights given to other users on the system. The only exception
  98.       is the owner's permissions (which is the first field) and permissions
  99.       given to World (which is shown in the third field). Also note that
  100.       Administrator's and System's rights are not indicated anywhere, i.e.
  101.       they may have full access to all files even if ls doesn't tell you.
  102.  
  103. OPTIONS
  104.      The following command-line options can be given to ls. ls will also
  105.      recognize these options if they are present in the environment variable
  106.      LSFLAGS. 
  107.  
  108.      -a   List all entries; in the absence of this option,
  109.            hidden entries and . and .. do not show up
  110.      -A   Same as -a, except don't show  `.' and `..'
  111.      -c   Show creation time instead of last modification time
  112.      -C   Force multi-column output, with entries sorted down the
  113.            columns;  this is the default when output is to a terminal.
  114.      -1   Force one column output; this is the default when output is not
  115.        to a terminal.
  116.      -d   If argument is a directory, list only its name (not its contents);
  117.        often  used  with -l to get the status of a directory.
  118.      -D   Show MS-DOS short filenames (8+3 characters)
  119.      -F   Mark directories with a trailing slash /
  120.      -g   Show group ownership. See above for explanation.
  121.      -G   Same as -g, except that when group field becomes too long, only the
  122.        number of entries is shown, e.g. <10>. This makes the output
  123.        readable when many entries are present.
  124.      -h   Print version number and usage information
  125.      -I   Ignore case when sorting
  126.      -l   List in long format (required for many other options)
  127.      -L   Show names in lower case (FAT file-systems only)
  128.      -r   Reverse the order of sort to get reverse alphabetic or oldest first
  129.      -R   Recursively list subdirectories encountered
  130.      -t   Sort by time modified (latest first) instead of by name
  131.      -u   Show time for last access instead of last modification time
  132.      -z   Show DOS attributes
  133.  
  134.  
  135. BUGS
  136.      The ? output for owner protection should be removed. This involves
  137.      a group check membership for the owner though.
  138.  
  139.      The output device is assumed to be 80 columns wide.
  140.  
  141. COPYRIGHT
  142.      This program can be freely distributed and used as long as it is
  143.      not sold or made part of any commercial product. No responsibility
  144.      is taken for the program, for its output, correctness etc. Use it
  145.      on your own risk.
  146.  
  147. AUTHOR
  148.      Please send comments, suggestions and bug reports to:
  149.     Tomas Olovsson  [olovsson@ce.chalmers.se]
  150.  
  151.