Find Files by Size and Time in Linux¶
Introduction¶
Advanced find usage helps when the basic form is not enough. This article focuses on realistic command patterns that are useful during administration and troubleshooting.
When You Need Advanced Usage¶
Use find when you need to locate files by name, type, size, owner, or age. It is especially useful for cleanup tasks and finding large files on full filesystems. Advanced usage is most useful when you need to narrow scope, work on multiple targets, or diagnose why the first command did not answer the question.
Practical Examples¶
Inspect first:
find /tmp -maxdepth 1 -type f
Run a focused command:
find /var -type f -size +100M
Use a real-world pattern:
find /home -mtime +30 -type f
Troubleshooting¶
If find does not give the expected result, verify the target first with find /tmp -maxdepth 1 -type f. Then check permissions, paths, service state, network reachability, package repositories, or process state depending on what the command manages.
Example output:
/etc/passwd
Common Mistakes¶
- Forgetting to quote wildcard patterns such as
*.log, causing the shell to expand them too early. - Using
-deletebefore printing and reviewing the matches. - Searching from
/without limiting scope, which can be slow and noisy.
Safety Notes¶
Use a preview, backup, dry run, read-only command, or smaller test target before applying broad, recursive, destructive, or remote operations.
Related Guides¶
Summary¶
Advanced find usage should still be controlled. Build the command step by step and verify the result separately.