Command note chmod, umask

Source: Internet
Author: User

Changing access rights chmod

Format: chmod [Who][+1-1=][mode] FileName

Parameters: Who=u, g O, a

Mode: +-=

Rights alphanumeric combination: R-4 w-2 x-1 r-x-5 r---4--x-1


#chmod u=rwx,g=r--, o=r--123.txt

#chmod 744 123.txt

#ls-L 123.txt

-rwxr--r--1 root root 12777 December 4 20:31 123.txt

Adding or deleting a file to a permission

# chmod u-x,g+w,o--123.txt

# ls-l 123.txt

-rw-rw-r--1 root root 12777 December 4 20:31 123.txt

Chmod-r XYZ Filname

-R indicates cascading changes

Root User directory permissions default 755, file default permissions 644


UMASK Specifies the default file or directory permissions

View Umask Value input Umask Enter, default is 0022, directory permission is 755, file permission is 644

All directories under Linux must have X permissions

0022 usually only after three bits 022=----w-w-

Note: The user establishes the ordinary file does not have the X permission namely 666, the directory permission all is open namely 777

755 rwx rwx rwx-----w-w-= rwx r-x r-x

644 rw-rw-rw------w-w-= rw-r--r--


Command note chmod, umask

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.