chmod [options] mode[,mode] file1 [file2 ...]
change the permission for one or several files
Add execute-by-user permission to file:
chmod u+x file
Either of the following will assign read/write/execute permission by owner (7), read/execute permission by group (5), and execute-only permission by others (1) to file:
chmod 751 file chmod u=rwx,g=rx,o=x file
Any one of the following will assign read-only permission to file for everyone:
chmod =r file chmod 444 file chmod a-wx,a+r file
The following makes the executable setuid, assigns read/write/execute permission by owner, and assigns read/execute permission by group and others:
chmod 4755 file
chmod 777 it can be read/write and execute
s Set user (or group) ID.
t Sticky bit; used on directories to prevent removal of files by non-owners.
u User’s present permission.
g Group’s present permission.
o Other’s present permission.
|6||read and write||110|
|5||read and execute||101|
|3||write and execute||011|
Print information about files that are changed.
-f, –silent, –quiet
Do not notify user of files that chmod cannot change.
Print help message and then exit.
Traverse subdirectories recursively, applying changes.
Change permissions to match those associated with filename.
Print information about each file, whether changed or not.
Print version information and then exit.
(the fist letter)
a ll (default)
+ for Add permission.
- for remove permission
= for Assign permission (and remove permission of the unspecified fields).