passing grep results to other unix commands

This is old news to a lot of folks, but new and powerful to me.

Search for text in files and move matching files

$ grep --files-with-matches --null foo * | xargs --null -I xxx mv xxx dir_for_foos/

The above command searches for the string foo in all files in the current subdirectory.  It then moves each file to a specified directory.

Read a list of files from a text file and move those files somewhere

$ xargs -a ok.txt  -I xxx mv xxx /var/lib/accounting/joblogs/parsed