How to Search for Files in Linux (find)

find searches a directory tree for files and directories matching criteria like name, type, size, or modification time.

Published September 30, 2026

find searches a directory tree for files and directories matching criteria like name, type, size, or modification time.

Key points

  • find . -name "*.log" finds all files ending in .log starting from the current directory
  • find . -type d finds only directories; -type f finds only regular files
  • Combine with -exec to run a command on every match, e.g. find . -name "*.tmp" -exec rm {} \;

Example

find . -name "*.log" -mtime +30
More Linux articles