Good solution, but you could run into trouble if the resulting command line is bigger than the maximum size supported by the OS.
Of course, you will only run into trouble if your xargs is broken. The point of using xargs is to avoid the problem you are describing.
The disadvantage of using -exec is that find will spawn a grep process for each file found, while with the use of xargs, far less processes will be spawned.
Abigail
In reply to Re: Find file that contains "....." (command in Unix)
by Abigail-II
in thread Find file that contains "....." (command in Unix)
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |