Linux Move Files Older Than N Days to Another Directory

Feb 24, 2021

Move files in /source/photos to /destination/photos/

find /source/photos -maxdepth 1 -mtime +30 -type f -exec mv "{}" /destination/photos/ \;

NOTE: Use -maxdepth 1 to avoid moving files in sub directories

Check files older than N days

find . -maxdepth 1 -mtime +30 -type f -exec ls -l {} \;

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.