home *** CD-ROM | disk | FTP | other *** search
- $Id: chmod.doc 1.3 1997/06/08 22:18:51 brian Exp $
-
- chmod.doc : The 'chmod' command
- By: Brian E. Yoder.
-
- (c) Copyright International Business Machines Corporation 1997
- All rights reserved.
-
- The chmod command is an alternative to the ATTRIB command. It allows
- you to change the attributes (file mode) of one or more files. It can
- process hidden and system files in addition to ordinary files.
-
- The Win32 version of chmod will change the specified attributes of
- matching directories. The DOS and OS/2 versions of chmod ignore matching
- directories.
-
- Unlike ATTRIB for DOS and OS/2, chmod treats a readonly file as
- lacking the 'write' capability rather than having the 'readonly'
- capability.
-
- ========================================================================
- Command syntax
- ========================================================================
-
- chmod [ -R ] [ +-= ][ wsha ] fpsec ...
-
- If -R is specified, then chmod recursively descends subdirectories
- looking for matching files. The -r flag is compatible with the AIX and
- the original unix versions of chmod.
-
- The first argument must contain exactly one of the [+-=] file mode
- operators followed by one or more of the [wsha] file mode letters, with
- no intervening spaces.
-
- One or more file specifications must follow. A file specification
- consists of some combination of drive, path, and filename. The filename
- may contain AIX shell pattern-matching characters. See the pattern.doc
- file for a description of filename pattern matching.
-
- The file mode operator can be one of the following:
-
- + Set the specified file mode(s).
-
- - Reset the specified file mode(s).
-
- = Set the specified file mode(s) and clear the modes that aren't
- specified.
-
- The file mode letters have the following meanings:
-
- w Write permission.
-
- s System attribute.
-
- h Hidden attribute.
-
- a Archive attribute.
-
-
- ========================================================================
- Examples
- ========================================================================
-
- chmod -w * Reset the write permission for all of the files in the
- current directory, making them readonly.
-
- chmod -R -w * Reset the write permission for all of the files in
- the current directory and in all subdirectories,
- recursively.
-
- chmod +ha *.exe Make the .exe files in the current directory hidden, and
- set their archive bits.
-
- chmod -a *.c Reset the archive attribute for all of the .c files in
- the current directory.
-
- chmod =sh \* For all of the files in the root directory, set their
- system and hidden attributes and reset their write
- permission and archive attribute. When complete, the
- files will be unwritable (readonly), system, and hidden,
- and their archive attributes will be zero.
-