On Thu, Jun 4, 2009 at 08:52, Steve <[email protected]> wrote: > I am trying to use chown -R to selectively change permissions on files. > > A series of files are contained in many folders under the root data folder. No > files are stored in the data folder itself. > > Running > > chown -R user:group /data/*.dat > > run > from /data generates an error indicating no files match. If I move a > .dat > file into /data the ownership changes in that folder but not those > below. > > chown -R user:group /data/* > > works as expected > > Is there a way to selectively change files recursively ?
Use find to select the files and pipe the output to xargs: find . -name ... -print0 | xargs -0 -- chown ... -- ach

