How to Find Files by User Name in Ubuntu (find -user)

The Ownership Audit

In Ubuntu Linux, managing a shared server or a multi-user workstation requires strict oversight of file ownership. If a specific user (like “sarah” or “developer1”) begins complaining that their disk quota is full, or if you need to migrate all of a user’s data to a new server, you must be able to locate every single file they own across the entire filesystem. Manually checking the properties of every folder is impossible. You must instruct the search engine to filter specifically by the account name.

Using the find Command with -user

The Linux find command utilizes the -user flag to search for files based exclusively on the textual username of the owner.

  1. Open your Terminal application (Ctrl + Alt + T) or log into your server via SSH.
  2. To search the /var/www/ directory for every file and folder owned by the user “sarah”, type the following command exactly:
  3. sudo find /var/www/ -user sarah
  4. Press Enter and provide your administrator password.

System-Wide Discovery

The -user flag is a fundamental tool for Linux administrators. Because a user’s files can be scattered across multiple directories (/home/, /var/log/, /tmp/), running this command against the root directory (/) allows you to instantly generate a comprehensive manifest of everything that user has created or modified. This command is absolutely essential for diagnosing permission errors (e.g., finding files in Sarah’s directory that she accidentally assigned to the root user) and for executing clean, complete data migrations.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.