home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / utlos2.zip / Doc / chmod.doc < prev    next >
Text File  |  1997-10-24  |  3KB  |  81 lines

  1. $Id: chmod.doc 1.4 1997/10/25 02:01:45 brian Exp $
  2.  
  3.                     chmod.doc : The 'chmod' command
  4.                           By:  Brian E. Yoder.
  5.  
  6.         (c) Copyright International Business Machines Corporation 1997
  7.         All rights reserved.
  8.  
  9. The chmod command is an alternative to the ATTRIB command. It allows you
  10. to change the attributes (file mode) of one or more files. It can
  11. process hidden and system files in addition to ordinary files.
  12.  
  13. The Win32 version of chmod will change the specified attributes of
  14. matching directories. The DOS and OS/2 versions of chmod ignore matching
  15. directories.
  16.  
  17. Unlike ATTRIB for DOS and OS/2, chmod treats a readonly file as lacking
  18. the 'write' capability rather than having the 'readonly' capability.
  19.  
  20. ========================================================================
  21. Command syntax
  22. ========================================================================
  23.  
  24.         chmod [ -R ] [ +-= ][ wsha ] fpsec ...
  25.  
  26. If -R is specified, then chmod recursively descends subdirectories
  27. looking for matching files. The -r flag is compatible with the AIX and
  28. the original unix versions of chmod.
  29.  
  30. The first argument must contain exactly one of the [+-=] file mode
  31. operators followed by one or more of the [wsha] file mode letters, with
  32. no intervening spaces.
  33.  
  34. One or more file specifications must follow. A file specification
  35. consists of some combination of drive, path, and filename. The filename
  36. may contain AIX shell pattern-matching characters. See the pattern.doc
  37. file for a description of filename pattern matching.
  38.  
  39. The file mode operator can be one of the following:
  40.  
  41.      +  Set the specified file mode(s).
  42.  
  43.      -  Reset the specified file mode(s).
  44.  
  45.      =  Set the specified file mode(s) and clear the modes that aren't
  46.         specified.
  47.  
  48. The file mode letters have the following meanings:
  49.  
  50.      w  Write permission.
  51.  
  52.      s  System attribute.
  53.  
  54.      h  Hidden attribute.
  55.  
  56.      a  Archive attribute.
  57.  
  58.  
  59. ========================================================================
  60. Examples
  61. ========================================================================
  62.  
  63. chmod -w *      Reset the write permission for all of the files in the
  64.                 current directory, making them readonly.
  65.  
  66. chmod -R -w *   Reset the write permission for all of the files in
  67.                 the current directory and in all subdirectories,
  68.                 recursively.
  69.  
  70. chmod +ha *.exe Make the .exe files in the current directory hidden, and
  71.                 set their archive bits.
  72.  
  73. chmod -a *.c    Reset the archive attribute for all of the .c files in
  74.                 the current directory.
  75.  
  76. chmod =sh \*    For all of the files in the root directory, set their
  77.                 system and hidden attributes and reset their write
  78.                 permission and archive attribute. When complete, the
  79.                 files will be unwritable (readonly), system, and hidden,
  80.                 and their archive attributes will be zero.
  81.