A note about find and xargs

You can find lots of advice online, and in some Bash books, about using a program called xargs to accomplish something similar to theĀ -exec action of find:

$ find vim -type f -name '*.vim' | xargs grep -F search --

Using -exec for this sort of situation instead should be possible one way or another with some careful programming, and it's safer and more portable too, because the only safe way to use xargs is with the non-standard find -print0 and xargs -0 options that specify null-byte terminators between each file, to safely and correctly deal with filenames that contain newlines:

$ find vim -type f -name '*.vim' -print0 | xargs -0 grep -F search --
Yes, file names on Unix can contain newlines, not just spaces. If your find command is going through a directory of files controlled by someone else, it's especially important to accommodate this, as it will break your script.