Ways to set Linux file and directory permissions

Source: Internet
Author: User

1. Character notation

Type operation permissions

U +r

G -W

o =x

A


The type represents the object that modifies the permission, U represents the user of the file, G represents the group of the file owner, O represents a non-user group user, and a represents Ugo

Action + represents an increase in permissions,-Indicates reduced permissions, = indicates permissions granted

The permission R is read-only, W is writable, and X indicates an executable


[[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 are the test commands, see

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, rwx numeric representation is 4+2+1=7, which is actually a binary representation, rwx three-bit bit,111, or 7


Example:

chmod 577 Test

chmod 555 Test

Chmod-r 754 test//-r parameter means recursion


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Ways to set Linux file and directory permissions

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.