Quantcast
Channel: Move files to another directory which are older than a date - Server Fault
Viewing all articles
Browse latest Browse all 6

Answer by harleygolfguy for Move files to another directory which are older than a date

$
0
0

Be careful when using the above solutions, I used them and ended up moving all files in all subfolders!!!!

This command moves all files in /source directory and all subfolders under source directory:

find /sourcedirectory -mtime +365 -exec mv "{}" /destination/directory/ \;

Instead, use option -maxdepth 1 for only files in /sourcedirectory

find /sourcedirectory -maxdepth 1 -mtime +365 -exec mv "{}" /destination/directory/ \;

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>