In linux, change the folder permission and change the file owner.
Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
In linux, the command chmod is used to change the folder permission and change the folder permission of the file owner. when you want to use the chmod command to change the permission, add a letter to the chmod and then a file name (for example, chmoda + x) www.2cto.com. the user identity of the file mainly includes the following types: u (user...
In linux, the command chmod is used to change the folder permission and change the folder permission of the file owner. chmod is followed by a letter, followed by a file name (such as chmod a + x) www.2cto.com. when you want to use the chmod command to change the permission, the user identity of the file mainly includes the following types: u (user): Users with files (owner); g (group): group where the owner is located; o (other): others (group not the owner or owner);: everyone or all (u, g, and o ). The user has the following file access permissions: r: read permission; w: write permission; x: execution permission. The file permission configuration behaviors include: +: add permission;-: delete permission; =: make it the only permission. Therefore, any user of chmod a + x has the execution permission. is chmod followed by a number, followed by the file name to explain, in fact, the form of the entire command is sudo chmod-(representing the type) ××× (owner) ××× (group user) each digit of XXX (other users) represents a permission setting of the user type. The value ranges from 0 ~ 7, that is, the binary  ~ . Each digit of the three binary numbers represents the read, write, and execution permissions respectively. For example, "000" indicates that no three permissions are available, and "100" indicates read-only. In this way, we have the following correspondence: 0  no permissions 4  read-only permissions 6  read and write permissions 7  read and write execution permissions www.2cto.com change the usage of the file owner command chown: chown [option]... [owner] [: [group] file... or: chown [option]... -- reference = reference file... purpose: change the owner of each file and/or its group-c, -- changes is similar to verbose, but the result is displayed only when there is a change -- dereference is affected by the object indicated by the symbolic link, instead of the symbolic link itself-h, -- no-dereference will affect the symbolic link itself, rather than the destination indicated by the symbolic link (when the system supports changing the owner of the symbolic link, this option is useful) -- from = current owner: the current group www.2cto.com changes the owner and group only when the owner and group of each file comply with the option. One of these attributes can be omitted. in this case, the omitted attributes do not need to conform to the original attributes. -- No-preserve-root does not treat "/" (default) -- preserve-root does not allow recursive operations on "/"-f, -- silent, -- quiet removes most of the error messages -- reference = use the reference file's group instead of the specified value-R, -- recursive recursively processes all files and subdirectories-v, -- verbose displays diagnostic information for all processed files
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.