:: krowemoh

Wednesday | 15 OCT 2025
Posts Links Other About Now

previous
next

Find Cheatsheet

2025-09-26
sysadmin, cheatsheets

Delete files by mtime:

find . -type f -mtime +5  -delete

The above command will delete files that are older than 5 days.

Move files by mtime:

find . -type f -mtime +380  -exec mv {} /path/to/dir/ \;

This will find the files that have a mtile older than 380 days and then it will move them to a new location. the ; is the way to end the command so that you can add more flags after the exec.