Ways to set permissions for Linux files and folders

Source: Internet
Author: User

1. Character notation

Type operation permissions

U +r

G -W

o =x

A


The type represents an object that changes permissions, and U represents the user of the file. G represents the group of all the files, O represents a non-user group of users. A means Ugo

Action + Represents the addition of permissions,-Indicates reduced permissions, = indicates permissions granted

Permission r means read only, W is writable, X is operational


[[Email protected] ~] # mkdir Perm

[[Email protected] ~] # CD Perm

[[email protected] perm] # mkdir Test

[[email protected] PERM] # CD Test

[[email protected] test] # touch Test1

[[email protected] test] # touch Test2


Here is the test order, see details

chmod u-w Test

chmod g+w Test

chmod ug+w Test

chmod ugo-x Test

chmod a+x Test

chmod o=w Test

chmod a= Perm

Chmod-r a+rwx Perm



2, digital notation

Permission numbers

R4

W2

X1

-0


For example, the rwx number means that 4+2+1=7, which is actually a binary representation, rwx three-bit bit,111, or 7


Examples:

chmod 577 Test

chmod 555 Test

Chmod-r 754 test//-r reference meaning recursive


Ways to set permissions for Linux files and folders

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.