15, Linux file Basic Properties Chgrp,chown,chmod

Source: Internet
Author: User

Linux file owner and owner group Change file properties 1, chgrp: Change file group

Grammar:

[-R] belongs to group name file   name

Parameter options

    • -R: Recursively change the group of files, that is, when you change the genus of a directory file, if you add the-r parameter, the group of all files under that directory will change.
2, Chown: Change the owner of the file, you can also change the file group

Grammar:

Chown [-R] is the main name file Name

Chown [-R] belongs to the main name: The name of the group name

3, chmod: Change the file 9 properties

There are two ways to set up Linux file attributes, one is a number and one is a symbol. Linux files have the basic permissions of nine, respectively, owner/group/others three identities each have their own Read/write/execute permissions.

[-R]r:4 w:2 x:1

Symbol Type Change file permissions

There is also a way to change the permissions yo! From the previous introduction, we can find that basically nine permissions are (1) User (2) group (3) Others three kinds of identities! Then we can represent three kinds of identities by u, G, O!

In addition, a represents all and all identity! Then the permission to read and write can be written as R, W, x! That is, you can see it in the following way:

chmod U
G
O
A
+ (Join)
-(remove)
= (set)
R
W
X
File or directory

If we need to set the file permissions to-rwxr-xr--, you can use the chmod u=rwx,g=rx,o=r file name to set:

15, Linux file Basic Properties Chgrp,chown,chmod

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.