cd /your/old/dir/ cp `grep -rl 'NNNN' *` /your/new/dir/ #### for file in `grep -rl 'NNNN' *` ; do cp $file dstdir/ ; done