chmod changes the access permissions of the named files. Synopsis:
chmod [option]... {mode | --reference=ref_file} file...
chmod never changes the permissions of symbolic links, since the chmod system call cannot change their permissions. This is not a problem since the permissions of symbolic links are never used. However, for each symbolic link listed on the command line, chmod changes the permissions of the pointed-to file. In contrast, chmod ignores symbolic links encountered during recursive directory traversals.
A successful use of chmod clears the set-group-ID bit of a
regular file if the file's group ID does not match the user's
effective group ID or one of the user's supplementary group IDs,
unless the user has appropriate privileges. Additional restrictions
may cause the set-user-ID and set-group-ID bits of mode or
ref_file to be ignored. This behavior depends on the policy and
functionality of the underlying chmod
system call. When in
doubt, check the underlying system behavior.
If used, mode specifies the new file mode bits. For details, see the section on File permissions. If you really want mode to have a leading ‘-’, you should use -- first, e.g., ‘chmod -- -w file’. Typically, though, ‘chmod a-w file’ is preferable, and chmod -w file (without the --) complains if it behaves differently from what ‘chmod a-w file’ would do.
The program accepts the following options. Also see Common options.
An exit status of zero indicates success, and a nonzero value indicates failure.