[Slackbuilds-users] template find/chmod RFC

Tonus tonus1 at free.fr
Mon Aug 3 10:51:13 UTC 2026


"B. Watson" <urchlay at slackware.uk> writes:

> On Sun, 2 Aug 2026, Jim via SlackBuilds-users wrote:
>
>>> ----------------------------------------------------------------------
>>> find . ! -type l    -a \
>>>   \(     -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \
>>>   \(   ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \)
>>> ----------------------------------------------------------------------
>>
>> I know it is redundant to chmod a file to the perms it already has, but at
>> the cost of a few redundant chmod operations, would the clarity gained by
>> removing the " -a ! -perm 644 " clause (and the 755 one) be worth those
>> extra few chmods?
>
> It's not necessily a "few". If you have 10,000 files with correct
> permissions and only a few (or only one, or none at all) that need
> changing, your chmod commands will take 10,000 times as long as they
> need to.
>
> Part of my goal in changing the template is to avoid the long delay
> caused by the old find/chmod code.
> _______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - https://slackbuilds.org/faq/

Great changes and very clear explanation.

For the initial change, for the sake of technique and beauty !

Regards,

--
Regards,
Tonus.


More information about the SlackBuilds-users mailing list