Skip to main content
In this guide, you’ll learn how to quickly locate files on a Linux system using the powerful find command. Whether you need to hunt down large log files, uncover recently modified documents, or filter by permissions, find provides flexible options to suit your needs. By default, files on Linux are organized under standard directories:
  • SSH daemon configurations: /etc/ssh
  • System logs: /var/log
However, there are many scenarios where you must perform an arbitrary search:
  • Locate all image files beneath your web directory
  • Identify huge files when disk space is low
  • List files modified or created within a specific timeframe
Below, we cover the most common use cases with examples.

Basic Usage

The general syntax is:
If you omit search_path, find searches the current directory.
Omitting the search path is equivalent to specifying . (the current directory).

Examples

Specifying the Search Path First

Always place the directory to search before your search criteria. Incorrect (no results under /bin):
Correct:

Name-Based Searches

  • -name : case-sensitive filename match
  • -iname : case-insensitive filename match
  • Wildcards (*) match any sequence of characters

Time-Based Searches

You can filter files based on modification or change times.

Modified Time by Minutes (-mmin)

Modified Time by Days (-mtime)

  • 0 : within the last 24 hours
  • 1 : between 24 and 48 hours ago
  • +n : more than n days ago
  • -n : less than n days ago

Change Time (-ctime)

Tracks metadata changes (permissions, ownership):

Size-Based Searches

Filter files by size using the following suffixes:

Combining Expressions

By default, multiple expressions are combined with AND:

OR Operator

Use -o to OR expressions:

NOT Operator

Negate conditions with -not or an escaped !:

Permission-Based Searches

Search by file permission bits (octal notation): Examples (mode 664 = rw-rw-r--):
More permission filters:
Be careful to quote wildcard patterns (e.g., "*.txt"), especially when running in scripts or complex shells.

Further Reading & References

Watch Video

Practice Lab