I am on a remote machine attempting to move all loader.gif files into a /Pictures folderfind . -iname *.gif | grep loader shows four file I would like to move, naturally I tried: find . -iname *.gif | grep loader -exec cp *.gif /home/me/How could I copy all files matching my criteria of loader.gif through a find and a grep command? (I am using grep because the original find command results show ALL .gif files, but I only desire loader.gif filenames)
How could I run -exec on find command after | grep
grep;find;exec
GNUly:find . -iname '*.gif' -print0 | grep -z loader | xargs -r0 cp -t /home/mePOSIXly:find . -name '*.[gG][iI][fF]' -path '*loader*' -exec sh -c '  exec cp $@ /home/me' sh {} +(I used -path so it be equivalent with the grep solution, but it sounds like you want loader to be found in the name of the file as opposed to its directory components, in which case you should use -name instead).Note that -iname '*.gif' may fail to match on a .GIF in a locale where uppercase i is  instead of I (like Turkish locales on GNU systems).