How can I search the files based on the owner or group in command line?

Right now I have tried ls -lR, that gives all the details of files in sub directories also, and I needed to manually search the files owned by root.


You can use the find command:

find /path/to/directory -user root

For example:

$ find /var -user gdm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.