How to Find Readable Files in Ubuntu Linux (find -readable)

The Permission Check

In Ubuntu Linux, file permissions dictate exactly who is allowed to view the contents of a file. If you are logged in as a standard user (not the root administrator), there are thousands of system files and configuration documents you are strictly prohibited from reading. When searching for a specific configuration string or attempting to audit a directory, standard search algorithms will throw hundreds of “Permission denied” errors, completely clogging your terminal output. To perform a clean search, you must instruct the Linux engine to filter out any files that you do not have the authorization to open.

Using the find Command with -readable

The Linux find command utilizes the -readable flag to instantly isolate files that your current user account has the explicit permission to view.

  1. Open your Terminal application (Ctrl + Alt + T) or log into your server via SSH.
  2. To scan the /etc/ directory and exclusively return files that you can actually read without using `sudo`, type the following command exactly:
  3. find /etc/ -type f -readable
  4. Press Enter.

Combining with Content Search

The -readable flag is incredibly powerful when combined with the grep command for text searching. If you run find /var/log/ -type f -readable -exec grep "error" {} +, the engine will only attempt to read the log files you actually have access to, completely eliminating the wall of “Permission denied” errors that usually ruins standard text searches across secure directories.

Get the best tech tips delivered straight to your inbox.

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