On 08/06/2015 08:05, Raffaele BELARDI wrote:
> Volker Armin Hemmann wrote:
>> Am 06.06.2015 um 18:45 schrieb Joseph:
>>> I've bunch of php files in many directories and I need to file a text
>>> string in them "Check/Money Order"
>>>
>>> I've tried:
>>> find -type f -print0 | xargs -r0 grep -F 'Check/Money Order'
>>> it doesn't work.
>>>
>>> What is a better method of searching files?
>>
>> grep -R 'whateveryourarelookingfor /path/to/directory/tree/
>>
>> seriously, why make everything fucking harder with find, when grep alone
>> can do it for you?
>>
> 
> I'm not the OP but I was not able to make 'grep -R' work properly with 
> file or directory names containing spaces. I fiddled with IFS but in the 
> end I found 'find -print0' was more convenient. Are there better methods 
> with grep and shell alone?
> 
> raffaele
> 

grep deals with spaces in directory and file names just fine.

If you want to specify directory or file names on the command line that
contain spaces, you must quote them. Standard shell technique.

-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to