chown --recursive [OWNER][:[GROUP]] ... doesn't work

Eric Blake eblake@redhat.com
Wed May 25 08:44:00 GMT 2016


On 06/08/2013 12:50 PM, Corinna Vinschen wrote:
> On Jun  8 17:47, Vasiliy wrote:
>> chown --recursive <owner> *.* doesn't change ownership for all files,
> 
> Wrong pattern.  *.* doesn't match files without dot.  Try
> 
>   chmod -R * .*

Umm, that changes .. and its children, too, which is probably not what
you want. That, and long command lines can be problematic if the glob
expands to too much, you might have issues if there are no matches the
glob, and you have problems if any files begin with '-'.

Better is:

chmod -R owner .

and let chmod do the recursion over all files in '.' itself without
having to worry about how to glob all of them.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160525/46d1d59d/attachment.sig>


More information about the Cygwin mailing list