How To Change Owner 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. Check the current owner of the file:
Run the following command to check the current owner of the file:
ls -l <filename>
2. Change the owner of the file:
Run the following command to change the owner of the file:
chown <username> <filename>
For example, to change the owner of the file “test.txt” to the user “john”, run the following command:
chown john test.txt