What to do if the execution permission of the linux folder is insufficient

WBOY
Release: 2022-06-23 15:09:20
Original
7404 people have browsed it

In Linux, if the execution permission of the folder is insufficient, you can use the chmod command to modify the permissions. This command is a command for the file permissions of the null user. The file calling permissions can be divided into file owners, user groups and For other users, level 3, the syntax is "chmod [-cfvR] [--help] [--version] mode file...".

What to do if the execution permission of the linux folder is insufficient

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What to do if the execution permission of the Linux folder is insufficient

Modifying the permissions can solve this problem. Permissions can be modified using the chmod command.

Linux chmod (English full spelling: change mode) command is a command that controls user permissions on files

Linux/Unix file calling permissions are divided into three levels: File Owner (Owner) , user group (Group), other users (Other Users).

Syntax

chmod [-cfvR] [--help] [--version] mode file...
Copy after login

Parameter description

mode: Permission setting string, the format is as follows:

[ugoa...][[+-=][rwxX]...][,...]
Copy after login

where:

u means The owner of the file, g represents the person who belongs to the same group as the owner of the file, o represents other people, and a represents all three.

means adding permissions, - means canceling permissions, = means setting only permissions.

r means readable, w means writable, x means executable, and X means only when the file is a subdirectory or the file has been set to be executable.

Other parameter descriptions:

-c: If the file permissions have indeed been changed, the change action will be displayed

-f: If the file permissions cannot be changed, do not Display error message

-v: Display detailed information about permission changes

-R: Make the same permission changes to all files and subdirectories in the current directory (that is, change them one by one recursively) )

--help: Display auxiliary instructions

--version: Display version

The example is as follows:

Change the file file1 .txt is set to be readable by everyone:

chmod ugo+r file1.txt
Copy after login

Set file file1.txt to be readable by everyone:

chmod a+r file1.txt
Copy after login

Set files file1.txt and file2.txt to The file owner can write to the same group as the file owner, but others cannot write to it:

chmod ug+w,o-w file1.txt file2.txt
Copy after login

Add executable permissions to the owner of the ex1.py file:

chmod u+x ex1.py
Copy after login

Recommended learning: Linux video tutorial

The above is the detailed content of What to do if the execution permission of the linux folder is insufficient. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template