In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor today to show you how to modify file permissions in the Linux system, the knowledge points in the article are introduced in great detail. Friends who feel helpful can browse the content of the article together with the editor, hoping to help more friends who want to solve this problem to find the answer to the problem. Let's follow the editor to learn more about "how to modify file permissions in the Linux system".
Every file and directory in the Linux system has access permission, which is used to determine who can access and operate the files and directories in what way. The following tutorial network shares a specific method for Linux system to modify file permissions.
When you type ls-lh under ubuntu shell, the files in that directory are listed, such as:
And before each file is displayed, there is something similar to the red box, which means:
-represents the file d represents the directory, that is, there are three sets of character encoding after the folder, each group defines three kinds of access rights
R means the object is readable, w means the object is writable, x means the object is executable. If there is no certain permission, there will be a single break line in that permission. These three groups of permissions correspond to the three security levels of the object respectively:
Permissions of the file owner
Permissions of users in the same group
Permissions of other users
Modify file permissions chmodchmod there are two ways to modify file permissions: alphabetical and numeric
The alphabetical chmod u/g/o/a + /-/ = rwx file name means uuser means that the owner of the file ggroup indicates that it belongs to the same group as the owner of the file, that is, the user group oother indicates that someone other than the user group aall indicates that all three are + /-/ = meaning + increase permissions-revoke permissions = set permissions rread means readable, for a directory, if there is no r permission Then it means that the contents of this directory cannot be viewed through ls. Wwrite means writable. For a directory, if there is no w permission, it means that a new file cannot be created under that directory. Xexcute means executable. For a directory, if there is no x permission, it means that the directory cannot be entered through cd.
This test file, whose permissions are shown as rwx rmurx Rmerx, respectively:
File owner: read, write, execute permissions
Users in the same group: read and execute permissions
Other users: execute permission
To add or revoke permissions (+, -), such as to revoke the w permissions of the file owner (u).
$chmod Umurw test 1
The file is not writable at this time! People in the same group or others have similar permissions to increase or revoke.
Set permissions (=), such as setting permissions for files that are only written by those in the same group
$chmod Grouw test 1
If you need to set the permissions of owners, peers, and others at the same time, you can do this:
Digital rwx can be represented by numbers
Letter description r read permission, numeric code "4" w write permission, numeric code "2" x execute permission, numeric code "1"-does not have any permissions, numeric code "0" such as execution: chmod uprirwx journal gendarxreo test is equivalent to: chmod upright 7, test 5, test, that is, test
You can also recursively add permissions to all subdirectories or files under a directory, with the parameter-R added after it.
$chmod 777 test/-R 1
Thank you for reading, the above is the whole content of "how to modify file permissions in Linux system". Friends who learn to learn to hurry up to operate it. I believe that the editor will certainly bring you better quality articles. Thank you for your support to the website!
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.