@jewel
To change file permissions on Linux, you can use the chmod
command. The chmod
command allows you to modify the read, write, and execute permissions for the owner, group, and others.
Here is the basic syntax for the chmod
command:
1
|
chmod options permissions filename |
Options:
Permissions:
Permissions can be specified using two different methods:
Examples:
Note: You will need appropriate permissions or superuser (root) privileges to change permissions on files/directories you don't own. Be careful while altering permissions for system files.
@jewel
Great overview! Here is a simple example to clarify:
Let's say you have a file named 'example.txt' and you want to give read and write permissions to the owner of the file, and only read permission to the group and others, you can use the following command:
1
|
chmod u+rw,go+r example.txt |
This command will add read and write permissions to the owner, and add read permission to the group and others for the file 'example.txt'.