in reply to Re: grep or perl
in thread grep or perl

You have a small typo. I guess you meant this:

cd /your/old/dir/ cp `grep -rl 'NNNN' *` /your/new/dir/

If one needs another solution for any reason, there is always a for loop:

for file in `grep -rl 'NNNN' *` ; do cp $file dstdir/ ; done

Also, this will find files that contain match. Use "-L" in grep, if you want those files which do not contain match.

Leonid Mamtchenkov aka TVSET