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
stat function and stat command Explanation of [in...
We better start paying attention, because HTML Po...
Related articles: Beginners learn some HTML tags ...
1. MySQL transaction concept MySQL transactions a...
Table of contents Before transformation: After tr...
01. Command Overview The whatis command searches ...
About Docker Swarm Docker Swarm consists of two p...
In normal development, we usually use convex roun...
1. Install less dependency: npm install less less...
Table of contents 1. Reverse the numbers 2. Get t...
Description of the problem: When the number of as...
Scenario Description In a certain system, the fun...
It is very simple to build a kong cluster under t...
If you want to display extra text as ellipsis in ...
1. z-index is invalid in IE6. In CSS, the z-index...