recursive grep

Sakari Jalovaara sja at sirius.hut.fi
Fri Aug 25 19:37:41 AEST 1989


> find . -type f -print | xargs grep string

xargs pops up every couple of months in comp.unix.* but I haven't seen
this mentioned yet:

	Script started on Fri Aug 25 12:24:58 1989
	tmp (sirius) 11> touch 'file names can have spaces\
	and even newlines in them\!'
	tmp (sirius) 12> find . -type f -print | xargs grep helloWorld
	grep: ./file: No such file or directory
	grep: names: No such file or directory
	grep: can: No such file or directory
	grep: have: No such file or directory
	grep: spaces: No such file or directory
	grep: and: No such file or directory
	grep: even: No such file or directory
	grep: newlines: No such file or directory
	grep: in: No such file or directory
	grep: them!: No such file or directory
	tmp (sirius) 13> exit
	exit

	script done on Fri Aug 25 12:26:11 1989

You probably don't want to run "xargs rm" and such as root.
									++sja



More information about the Comp.unix.wizards mailing list