Pages

Thursday, 1 March 2012

Find and execute a command on the files found

find -mtime +365 -exec mv '{}' /path/to/copy/files/ \;


Find files whose modified time 365*24 hours and "+" would give me files 365 days ago.
"-exec" will help me execute a query, where "{}" is all the files or parameters given by find command. The "{}" are quoted in single quote '.
";" sign simplifies end of command.

No comments:

Post a Comment