Linux chmod Command Detailed

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.