On Thu, Jun 4, 2009 at 3:52 AM, 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
This command will attempt to descend through directories named "*.dat".
Since there are no such directories (unixspeak for 'folder'), no descent
occurs.
>
> 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.
Correct behavior.
>
> chown -R user:group /data/*
>
> works as expected
>
> Is there a way to selectively change files recursively ?
>
something with find(1).
Try
find /data -name "*.dat" -exec chown user:group {} \;
But understand it first. Understand the quoting. man find.
Dave
--
Caution, this account is hosted by gmail.
Strangers scan the content of all mail transiting such accounts.