Recursion without -R

Jesse W. Asher jessea at dynasys.UUCP
Sat Aug 18 11:13:28 AEST 1990


In article <13595 at ulysses.att.com>, swfc at ulysses.att.com (Shu-Wie F Chen) wrote the following:
>In article <494 at llnl.LLNL.GOV>, rjshaw at ramius.ocf.llnl.gov (Robert Shaw)
>writes:
>|>Hi. 
>|>
>|>What are some quick tricks for getting programs like chmod and chown to
>|>descend into all subdirectories? Programs without a -R option, that is.
>find . -print | xargs chown foo
>Of course, this only works if you have xargs, which is from System V and
>is also available on SunOS in their System V software installation option.

Why not just use "find . -exec chown foo {} \;"
Or if you have to do many different commands, use:

for x in `find . -print`
do
	chown foo $x
	chgrp foobar $x
	chmod 644 $x
done

This can be done from the command line and saves some time.



More information about the Comp.unix.questions mailing list