in reply to Re: grep or perl
in thread grep or perl
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.
|
|---|