[Slackbuilds-users] template find/chmod RFC
B. Watson
urchlay at slackware.uk
Mon Aug 3 01:53:30 UTC 2026
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.
More information about the SlackBuilds-users
mailing list