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

You might receive an issue where you require to find all the files that are owned by a specific user.  Run the below command to find all files on the server owned by the specific users.

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 below command that will store the output in a file called users_file.txt. Files owned by the entered username will be stored in a users_files.txt file.

find / -user $USERNAME > users_files.txt

Related Articles

How to set up a cron to take MySQL Database Backup daily and remove the older backup files that are older than 10 days?

Login to your Linux server using ssh. Open your crontab using the below command Crontab -e...

How to change SSH port on Ubuntu?

Please refer to the following steps to change the SSH port in Ubuntu. Login to your server via...

How to run ClamAV scan from SSH in cPanel server?

In this article, we'll discuss how to run ClamAV scan via SSH in cPanel/WHM server. ClamAV is one...

How to install OPcache in cPanel/WHM?

OPcache is a PHP extension and it helps to improve the performance of your php Website. OPcache...

How to block an IP address using .htaccess?

You can block traffic coming from any specific IP addresses with .htaaccess file. Please refer to...

  • 0 Users Found This Useful

Was this answer helpful?