find

find files by size
Find limit search depth
Find files older than X minutes

Find Inside File

Or

-r = recursive
-n = show line number
-w = whole word only (you can omit this if you need partial match).

Files files changed in last 1 day

-1 = changed in last 24 hours
+1 = changed earlier than 24 hours. Useful to find older files.

Delete files older than x days

To delete files older than 30 days, run

If you need to delete a partificular type of file, say .log files, use

Instead of “-exec rm -f {} \;”, find support -delete option

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *