Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rutgers!att!cbnewsh!wcs From: wcs@cbnewsh.att.com (Bill Stewart 201-949-0705 erebus.att.com!wcs) Newsgroups: comp.unix.questions Subject: Re: Recursion without -R Keywords: recursion Message-ID: <1990Aug21.204841.29065@cbnewsh.att.com> Date: 21 Aug 90 20:48:41 GMT References: <494@llnl.LLNL.GOV> <104905@convex.convex.com> Organization: Here, beside the rising tide Lines: 24 In article <104905@convex.convex.com> tchrist@convex.COM (Tom Christiansen) writes: ]In article <494@llnl.LLNL.GOV> rjshaw@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!