The chmod command is used to change access rights for Linux system files or directories.
There are two ways to use this command:
One is a text-setting method that contains letters and operator expressions;
The other is a digital setting method that contains numbers.
Access to a file or directory is divided into read-only, write-only, and executable three types.
chmod Common Command Parameters
Usage:chmod [OPTION] ... Mode[,mode] ... FILE ... Or: chmod [OPTION] ... Octal-mode FILE ... Or: chmod [OPTION] ...--reference=rfile FILE ... Change the mode of each FILE to mode. -C,--changes like verbose if only if a change is made --no-preserve-root does not treat '/' specially (the default) --preserve-root fail to operate recursively on '/' -F,--silent,--quiet suppress most error messages -V,--verbose output a diagnostic for every file processed --reference=rfile use rfile ' s mode Instead of MODE values -r,--recursive change files and directories recursively --help Display this Help and exit --version output version information and exit
Common Command Display
421 represents the Read, write, and execute permissions for a file, respectively
chmod: Changing the value of a property
chmod 755-r/system default critical "002: Default mask for System"
CHMOD 644/system default critical "Cat/etc/profile|grep Umask can see the default umask value"
Add file All user groups executable permissions
chmod a+x log2012.log "Some scripts do not execute or do not have X permissions"
Also modify different user permissions, comma delimited
chmod ug+w,o-x Log201.log
Use "=" To set permissions
chmod u=x hhh.txt ==> chmod
Assign Read permissions to all users
chmod a=r File
Linux chmod Command Detailed