A
cd ..
System

Find & Grep Power User Guide

Advanced find and grep commands for searching files and content like a pro.

2025-08-24
linux, cli, search

Find files by name

find /path/to/search -name "*.log"

Find files modified in last 7 days

find /var/log -type f -mtime -7

Find and delete files

Dangerous: Always test without -delete first!

find /tmp -name "*.tmp" -type f -delete

Find large files (> 100MB)

find / -type f -size +100M

Grep with line numbers

grep -n "error" app.log

Grep recursively in directory

grep -r "TODO" /project/src/

Grep with context (3 lines before/after)

grep -C 3 "exception" app.log

Case-insensitive grep

grep -i "warning" app.log

Grep for multiple patterns

grep -E "error|fatal|critical" app.log

Find + Grep combo

Search for "database" inside all .js files.

find . -name "*.js" -exec grep -l "database" {} \;

Was this useful?

Share with your team

Browse More