Recursion without -R
Bill Stewart 201-949-0705 erebus.att.com!wcs
wcs at cbnewsh.att.com
Wed Aug 22 06:48:41 AEST 1990
In article <104905 at convex.convex.com> tchrist at convex.COM (Tom Christiansen) writes:
]In article <494 at llnl.LLNL.GOV> rjshaw at ramius.llnl.gov writes:
]>What are some quick tricks for getting programs like chmod and chown to
]>descend into all subdirectories? Programs without a -R option, that is.
Sorry if this is a duplicate; the expire daemon hit while I was on
vacation.
find $* -depth -exec foo -args {} morestuff \;
which is slow (does things one at a time) but flexible, or
find $* -depth -print | xargs chown joeuser
The find command recursively searches directories; the -depth option
tells it to do things depth-first (sometimes important when you're
dealing with directory ownership/permission changes), the -exec
executes one command per found item, and the xargs takes names from
standard input and builds them into command lines.
--
Thanks; Bill
# Bill Stewart 908-949-0705 erebus.att.com!wcs AT&T Bell Labs 4M-312 Holmdel NJ
# There'll be a brand new war coming soon to a theatre near you - promise!
More information about the Comp.unix.questions
mailing list