In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to modify file permissions in linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The command for linux to modify file permissions is "chmod", and the chmod command is used to change the permissions of files and directories. The setting method is text or numeric code, and the syntax is "chmod [- R] permission value file name" or "chmod [- R] [ujime gjinomo a] [, -, =] [rje WJ x]".
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
What is the command for linux to modify file permissions
If you want to change the permissions of a file, only the administrator root and the owner can modify it
There are two ways to set the properties of a Linux file, one is a number, the other is a symbol.
There are nine basic permissions for Linux files, and each of the three owner/group/others identities has its own read/write/execute permissions.
We can use numbers to represent each permission. The score comparison table for each permission is as follows:
R:4
W:2
X:1
The three r/w/x scores for each owner/group/others need to be accumulated, for example, when the permission is: [- rwxrwx---] the score is:
Owner = rwx = 4 "2" 1 = 7group = rwx = 4 "2" 1 = 7 others =-= 0 "0" 0
So when we set the permission change, the permission number of the file is 770! The syntax for the directive chmod to change permissions is as follows:
Chmod [- R] xyz file or directory
Xyz: the permission attribute of the numeric type just mentioned, which is the sum of the values of the rwx attribute. -R: make continuous recursive changes, that is, all files in the subdirectory will change.
② symbol type changes file permissions
We can use u, g, o to represent the authority of the three identities!
In addition, a stands for all, that is, the full identity! Then read and write permissions can be written as r, w, x! That is, you can look at it in the following way:
If we need to set the file permissions to-rwxr-xr--, we can set them using the file name of chmod uplirwx journal gendrx journal oinitir.
Example:
Note: if a directory has write permission, other users can also delete files in this directory.
This is the end of the content of "how to modify file permissions in linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.