How To Change File Permissions In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Change permissions with chmod
The chmod command is used to change the permissions of a file or directory.
To use it, you specify the desired permission settings and the file or files you wish to modify.
Syntax:
chmod [permissions] [file or directory]
Example:
chmod 777 filename.txt
This command will give full access to the user, group and others.
2. Change permissions with chown
The chown command is used to change the file or directory owner and group.
Syntax:
chown [owner]:[group] [file or directory]
Example:
chown john:staff filename.txt
This command will set the owner of the file to john and the group to staff.