[LINUX] "Chmod" command to set permissions and access permissions for files and folders

Introduction

This time, I will introduce the "chmod" command that sets the permissions and access permissions of files and folders.

How to read file permissions

From the left, the 10 digits of the alphabet are [Details of authority], the part hidden in black is [Owner], and the staff next to it hidden in black is [Owner group]. スクリーンショット 2020-03-07 13.58.27.png Regarding [Details of authority], the one character on the left indicates whether it is a file, a directory, or a symbolic link. The next three characters indicate the owner's access authority, the three characters indicate the group user's access authority, and other user's access authority. R is readable, w is writable, x is executable, and-is no authority. It shows that.

A combination of commands used to change file permissions

Let's change the authority using the ones listed below. Think of it in three parts: [to whom], [grant or delete], and [what authority]. **-Which group should the authority be changed to? **

symbol meaning
u Owner authority
g Group permissions
o Privileges of other users
a All permissions

**-Whether to add or remove permissions **

symbol meaning
+ Add the authority described later
- Delete the authority described later
= Make it the authority described later

** ・ What authority to change **

symbol meaning
r Read permission
w Write permission
x Execution authority

Let's change the file permissions

**-Remove read permission for other users **

command


$chmod o-r (file name) 

**-Give execute permission to all users **

command


$chmod a+x (file name) 

in conclusion

Next time, I'd like to set file and folder permissions and access permissions using numbers in chmod. reference: chmod command Set permissions etc.! Detailed summary of chmod commands

Recommended Posts

"Chmod" command to set permissions and access permissions for files and folders
"Chmod" command to set file and folder permissions and access permissions (setting values)
[Linux] How to subdivide files and folders
[Linux] Compress folders and transfer files from remote to local
Manipulate files and folders in Python
How to set proxy, redirect and SSL authentication for Python Requests module
How to create * .spec files for pyinstaller.
Don't use rm command to delete files