man.lsPlain-English help for Unix commands

find Search for files by name, type, age or size

Walks through a folder and everything under it, and prints the files that match your tests. Use it when you know something about a file, such as its name, age or size, but not where it is. It can also run a command on every match.

Synopsis

find [PATH]... [EXPRESSION]
find PATH -name PATTERN -exec COMMAND {} +

Common options

Option or formWhat it does
-name PATTERNMatch the file name against a shell pattern such as "*.txt". Case-sensitive. Quote the pattern so the shell does not expand it
-iname PATTERNSame as -name but ignores upper and lower case, so "readme*" also matches README.md
-type cMatch by type: f for regular file, d for directory, l for symbolic link
-mtime NMatch by modification time in whole days. -mtime -1 is within the last day, -mtime +7 is more than 7 days ago
-size NMatch by size. Add a unit: k, M or G. +1M is larger than 1 megabyte, -10k is smaller than 10 kilobytes
-maxdepth NGo no more than N levels down. -maxdepth 1 stays in the starting folder. Put it before other tests
-exec COMMAND {} +Run a command on the matches. {} stands for the file names. End with + to pass many files at once, or a backslash and semicolon to run once per file
-deleteDelete every match. Dangerous: see the notes before using it

Examples

Find all .txt files under the current folder
find . -name "*.txt"
Find a file ignoring case
find . -iname "README*"
./docs/readme.md
Only regular files, one level deep
find . -maxdepth 1 -type f
Files changed in the last day that are not empty
find . -type f -mtime -1 -size +0c
Run a command on every match
find photos -name "*.jpg" -exec ls -l {} +
Delete old temporary files, checking the list first
find . -name "*.tmp" -type f && find . -name "*.tmp" -type f -delete

Notes

See also

Last reviewed 2026-10-07.