Skip to content

Find All files Owned by a Specific User in Unix/Linux

In some cases you may required to search all files owned by a particular user on Linux system. For example, you are hosting a cPanel server and there are mismatch with size of quota and home directory of user. In that case some of the files owned by user are outside of there home directory.

To find all files on the server owned by that user run the following command.

find / -user $USERNAME 

Replace $USERNAME with the actual username to whom you need to search files.

This command will search files owned by a particular user in entire file system. So it will take a long time. It is a good idea to store output to a files instead of showing on terminal.

find / -user $USERNAME > user-files.txt

All the files owned by the given username will be stored user-files.txt file.

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top