On Fri, Apr 10, 2009 at 12:32 PM, Kyle <k...@attitia.com> wrote:
> I should clarify;
>
> But then if I do a chmod -R 664 *.jpg (and
>> repeat for all other extensions), for some reason the chmod doesn't work.
>
> it works in the directory I'm presently in, but doesn't recurse.

Yes. Daniel explained why: *.jpg expands to a list of all files whose
name ends with .jpg *in the current folder*. There are no directories
in that list, so chmod has nothing to recurse into.

Daniel provided some find fu which should do what you want (I haven't
tried it, just glanced over it).

>
> ------------------------------------------------------------------------
> Kind Regards
>
> Kyle
>
> Kyle wrote:
>>
>> Hi Sluggers,
>>
>> I'm having a bit of grief with chmod and am hoping one of you gurus will
>> set me straight pls.
>>
>> I have a bunch of directories with a bunch of files (pictures) in each. I
>> want to set directories to 775 and files to 664.
>>
>> I can do a chmod -R 775 *. But then if I do a chmod -R 664 *.jpg (and
>> repeat for all other extensions), for some reason the chmod doesn't work.
>>
>> the man page says; 'chmod -R ug=rwxX *' (if I understand it correctly)
>> should change just the directories permissions for owner and group. (and I
>> could do an o=rxX after). But that just works on everything as well.
>>
>> What am I missing?
>>
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to