this post was submitted on 18 Aug 2024
35 points (94.9% liked)

Linux

5364 readers
256 users here now

A community for everything relating to the linux operating system

Also check out [email protected]

Original icon base courtesy of [email protected] and The GIMP

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 4 points 3 months ago (1 children)

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' after find has already -exec the cp -ltr command.

You probably want this:

find . -name '*-FLAIR' -name '*Aug 18*' -type d -ls -exec cp -lr -t ../../../media_links/ {} \;
[โ€“] [email protected] 1 points 3 months ago

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.