CHMOD: Read/Write File Attributes
chmod changes or displays the attributes for a particular file.
Command syntax:
chmod {(+|-)attribute} [file...]
file is the file or files of interest. Wildcards are accepted.
Using + before an attribute turns on the attribute. Using - turns off the attribute. The attributes are:
attribute | Description |
---|---|
R | Read only |
H | Hidden |
S | System |
V | Volume label |
D | Subdirectory |
A | Archive |
Example: This line makes myfile.exe a read-only file:
chmod +R myfile.exe
If no attributes are specified, chmod displays (but does not change) the file's attributes, in this form:
__A__SHR 0x27 IO.SYS
Mnemonic characters denote attributes that are "on"; underscored characters indicate that an attribute is "off." Thus, chmod can be handy for finding hidden and system files:
chmod *.*