Linux

find

CautionFind files

find <path> -name '<pattern>'

Recursively finds files by name/type/mtime/size.

Examples

  • find /var -name '*.log' -mtime +30Logs older than 30 days
  • find . -type f -size +100MFiles over 100MB

Syntax

find <path> [-name <pat>] [-type f|d] [-mtime n] [-exec ... \;]

Before you run it

Combined with -exec rm it can be destructive.

Used when you see

Logs are eating the disk
3
Hunt big/old log files with find
See the whole flow →

Related commands

  • grepSearch text
  • duDirectory size

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store