This time, I will introduce the "chmod" command that sets the permissions and access permissions of files and folders.
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]. 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.
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 |
**-Remove read permission for other users **
command
$chmod o-r (file name)
**-Give execute permission to all users **
command
$chmod a+x (file name)
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