How To Change The Permissions Of a File 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. Open the terminal window.
2. Use the command “chmod” followed by the desired permissions and the file name.
3. For example, to give read and write permissions to a file called “myfile”, use the command:
sudo chmod u+rw myfile
4. To give all users read and write permissions to the file, use the command:
sudo chmod a+rw myfile
5. To set the permissions of a file so that only the owner can read and write it, use the command:
sudo chmod u=rw myfile
6. To set the permissions of a file so that only the owner can read and no one else can write to or access it, use the command:
sudo chmod u=r myfile