Finding files and copying to a another place
by hacback17 from LinuxQuestions.org on (#5B9XV)
Hi pals, I am trying to find all the files that are more than 2 days old, then only taking 10 files and copying them to my current working directory. The command I am using is
Code:sudo find / -type f -mtime +2 2>/dev/null -exec tail -n 10 {} \; -exec cp {} . \;but this doesn't produce the expected output. And, I'm not able to spot the mistake. Could you please help?


Code:sudo find / -type f -mtime +2 2>/dev/null -exec tail -n 10 {} \; -exec cp {} . \;but this doesn't produce the expected output. And, I'm not able to spot the mistake. Could you please help?