Use the Linux In Linux, who can do what with a file or directory is controlled through a set of permissions. Permissions control the operations (read, write, or execute) that can be performed on a file or directory. We can use the ls -l In each line, the first character identifies the type of entry listed. If it is a dash ( The next nine characters represent three sets of permission settings. The first three characters show the permissions of the user who owns the file ( User Rights ). The middle three characters show the permissions of the user group membership ( group permissions ). The last three characters show permissions for anyone outside the first two categories ( other permissions ). There are three characters in each set of permissions. The character is an indicator of whether the permission is present or not. They are either a dash ( The letters represent: r : Read permission. You can open the file and view its contents. w : write permission. This file can be edited, modified and deleted. x : Execute permission. If the file is a script or program, it can be run (executed). For example: Syntax for setting permissions To set permissions with who : For whom we are setting permissions. what : What changes are we making? Are we adding or removing permissions? which: Which permissions did we set? We use indices to represent these values and form short "permission statements" such as The "who" values we can use are: u : user, indicating the owner of the file. g : Group, indicating the members of the group to which the file belongs. o : Others, meaning people who are not managed by a : All, meaning all of the above. The values we can use for " what " include: – : Minus sign. Remove permissions. + : Plus sign. Grant permissions. The permission is added to the existing permissions. If you want to have this permission and only set this permission, use the = : equal sign. Set permissions and remove others. The "which" values we can use are: r : Read permission. w : write permission. x : Execute permission. Examples: We can add execute permissions for everyone with the following command: chmod a+x new_script.sh We want user dave to have read and write permissions, while group and other users have only read permissions. We can use the following command: chmod u=rw,og=r new_file.txt Using the "=" operator means we clear all existing permissions and then set the specified permissions. This is the end of this article about the detailed analysis of the chmod command to modify file permissions under Linux. For more relevant Linux chmod command content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Example code for implementing beautiful clock animation effects with CSS
>>: Detailed explanation of html printing related operations and implementation
The animation part of CSS will be blocked by JS, ...
Table of contents 1. Component 2. keep-alive 2.1 ...
If you're collecting information from your us...
If you are looking to monitor your system interac...
There is a medicine for regret in the world, as l...
In Linux, when a file is created, the owner of th...
When using MySQL to query the database and execut...
Table of contents 1. Create components using func...
This article summarizes the implementation method...
First of all, this post is dedicated to Docker no...
After watching this, I guarantee that you have ha...
This article example shares the specific code of ...
There are two types of web page box models: 1: Sta...
This work uses the knowledge of front-end develop...
1: readonly is to lock this control so that it can...