Board index SCRIPTS Miscellaneous

Find list of files modified in the last X days

Postby a24uall » Mon Jul 16, 2012 8:54 am

Get in to the directory that you want the files to be checked.
cd /home/username/public_html
Below command displays all files recursively that have been modified in the past 6 days.
find . -mtime -6
Arun
WebhostingDevelopment.com
a24uall
Site Admin
 
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

Re: Find list of files modified in the last X days

Postby a24uall » Wed Dec 25, 2013 11:59 am

How to move files older than X days to a new folder

find /source/folder/path/ -mtime +X -exec mv {} /destination/folder/path/ \;


Example

cd /home/arun/mail/arunp.in/
find cur/ -mtime +365 -exec mv {} /home/arun/mail/arunp.in/arun/.2012/cur/ \;
Arun
WebhostingDevelopment.com
a24uall
Site Admin
 
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am


Return to Miscellaneous

Who is online

Users browsing this forum: No registered users and 1 guest


cron