How To Check Owner Of Directory 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. Use the ls command.
The ls command is the most basic command for viewing the contents of a directory, including the owner of the directory. To view the owner of a directory, use the -l flag with the command:
$ ls -l
The output of this command will show the owner of the directory at the beginning of the line.
2. Use the stat command.
The stat command is a more detailed version of the ls command and can be used to view a variety of information about a directory, including the owner of the directory. To view the owner of a directory, use the -c flag with the command:
$ stat -c%U <directory name>
The output of this command will show the owner of the directory.