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.

Advertisement

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.

Share.
Leave A Reply

Exit mobile version