How to Find All the Files Owned by a Specific User in Unix/ Linux?

You can implement the command given below to find all files on the server owned by the specific users in case there is an issue where you need this function –   

find / -user $USERNAME 

You need to replace $USERNAME with the exact username for which you want to search the files. However, the above command may take some time to find out the files in the entire file system. 

You can run the command given below to store the output in a file called users_file.txt. 

find / -user $USERNAME > users_files.txt

Files owned by the user whose username you enter will be stored in the users_files.txt file.


Was this answer helpful?

« Back