How to change the permissions of files in a directory recursively

fbia at sina.com fbia at sina.com
Tue Apr 25 04:19:33 UTC 2017



Smoot Carl-Mitchell <smoot at tic.com>编写:

>On Mon, 2017-04-24 at 22:38 -0400, Rashkae wrote:
>> On 17-04-24 08:48 PM, Smoot Carl-Mitchell wrote:
>> 
>> > 
>> > 
>> > For a deep directory you can do:
>> > 
>> > find <dir> -type f -perm 766
>> > 
>> > which recursively finds all the regular files and changes their
>> > mode in
>> > the directory tree.
>> > 
>> > Smoot
>> > 
>> 
>> Umm, what?  -perm option to find searches for permissions, it
>> doesn't 
>> change anything.
>
>You are correct.  Should be something like:
>
>find <dir> -type f -exec chmod 766 {} \;
>
>or
>
>find <dir> -type f -print | xargs chmod 766
>
>
>-- 
>Smoot Carl-Mitchell
>System/Network Architect
>voice: +1 480 922-7313
>cell: +1 602 421-9005
>smoot at tic.com
>
>
>
>-- 
>ubuntu-users mailing list
>ubuntu-users at lists.ubuntu.com
>Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


More information about the ubuntu-users mailing list