In some cases, you may be required to search all files owned by a particular user on a Linux system. For example, you are hosting a cPanel server and there is a mismatch with the size of quota and home directory of the user. In that case, some of the files owned by user are outside of their 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, for example username “mytechmint”.
This command will search files owned by a particular user in the entire file system. So it will take a long time. It is a good idea to store output to a file instead of showing it on the terminal.
find / -user $USERNAME > user-files.txt
All the files owned by the given username will be stored user-files.txt file.