Find Cheatsheet

Find command for file searching, filtering, and batch operations

File Search6 commandsbeginner

Overview

Find searches the filesystem for files matching specified criteria.

Why It Matters

Find is powerful for locating files with complex criteria and executing operations on them.

Essential Commands

find . -type f -name "*.ts"

Find TypeScript files recursively

find . -type d -name "node_modules" -prune

Locate matching directories

find . -mtime -1

Find files modified in last day

find . -size +10M

Find files larger than 10MB

find . -type f -exec chmod 644 {} +

Run command on matched files

find . -type f -print0 | xargs -0 wc -l

Pipe safe null-delimited results

Quick Start

Start with the search by name, type, size, and modification date

Key Concepts

Search by name, type, size, and modification date

Execute commands on found files with -exec

Use regex patterns for advanced matching

Pro Tips

  • Combine multiple commands for powerful workflows
  • Use aliases to speed up your command entry
  • Create scripts to automate repetitive tasks

Common Pitfalls to Avoid

  • Forgetting to check the documentation for edge cases
  • Running commands without understanding their full impact
  • Not testing changes in a safe environment first

Related Resources

9 items