Search and Filtering

find

Searches for files by name, type, time, size, and more.

find walks directory trees and matches filesystem objects. It is powerful enough to combine searching with actions.

Syntax
find path [tests] [actions]

Arguments explained

  • path is where to start.
  • -name matches names with shell-style patterns.
  • -type f finds files; -type d finds directories.
  • -mtime filters by modification days.
  • -exec runs a command for each match.

Common examples

Find log files
find /var/log -type f -name "*.log"

Searches for regular files ending in .log.

Find large files
find ~ -type f -size +500M

Locates files larger than 500 MB under your home directory.

find Command
FieldDetails
Commandfind
CategorySearch and Filtering
Primary useSearches for files by name, type, time, size, and more.
Syntaxfind path [tests] [actions]