Karunakar
Karunakar

Reputation: 2349

Copying Files that have been modified in the last 5 days to a new folder

I need to copy files modified last 5 days in a folder. I am having this command

find /media/karunakar/Suppliers/xyz/ORD20130908 -name "*.DAT" -type f -mtime +5 -exec cp '{}' /media/karunakar/ord

it is not giving result

Upvotes: 1

Views: 288

Answers (1)

Srini V
Srini V

Reputation: 11365

Try this:

$(which find) $FOLDER_FROM_COPY -type f -mtime +5 -regex '$\|.*dat$\|.*DAT$' -print | xargs -I '{}' -P4 -n1 $(which cp) {} $FOLDER_TO_COPY

Upvotes: 1

Related Questions