Your grep is getting the output of find piped into it, so there’s nothing in the find command itself (which has the -exec in there) to filter it down so it applies to everything find finds. You’re filtering for ‘Aug 18’ afterfind has already -exec the cp -ltr command.
Your
grepis getting the output of find piped into it, so there’s nothing in the find command itself (which has the-execin there) to filter it down so it applies to everythingfindfinds. You’re filtering for ‘Aug 18’ afterfindhas already-execthecp -ltrcommand.You probably want this:
Oh the files don’t have the date in their names. Is -name still gonna work with ‘Aug 18’? I’m parsing for the date shown by -ls.