🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Linux Beginner

What is Find?

A powerful command for searching files and directories based on various criteria like name, size, type, and modification time.

Find traverses directory trees to locate files matching specified criteria. Examples: find /var/log -name "*.log" -mtime -7 (logs modified in last 7 days), find . -size +100M (files over 100MB), find . -type d -empty (empty directories).

The -exec flag runs commands on results: find . -name "*.tmp" -exec rm {} \;. Combining with -print0 and xargs -0 handles filenames with spaces safely. Find is essential for system administration and cleanup tasks.