Commands.app

find

File Management

Search for files and directories in a directory hierarchy

Options & Flags
Available options for this command
-name pattern

Search by filename pattern

-type f/d

Search for files (f) or directories (d)

-mtime n

Find files modified n days ago

-size n

Find files by size

Examples
Common usage examples

Find all .txt files in current directory and subdirectories

find . -name '*.txt'

Find files in /var/log older than 30 days

find /var/log -type f -mtime +30

Find log files larger than 100MB

find . -name '*.log' -size +100M
Notes
  • Very powerful when combined with -exec to perform actions on found files
  • Use -iname for case-insensitive search
Related Commands
You might also find these useful