[Slackbuilds-users] template find/chmod RFC

Franzen slackbuilds at schoepfer.info
Mon Aug 3 11:57:19 UTC 2026


Am 2026-08-03 00:43, schrieb B. Watson:
> RFC for new find/chmod in the SBo templates
> ===========================================
> 
> Please respond to this, if you have any opinion at all (for or
> against the proposed change).
> 
> The existing template code:
> 
> ----------------------------------------------------------------------
> find -L . \
>  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
>   -o -perm 511 \) -exec chmod 755 {} \; -o \
>  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
>   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
> ----------------------------------------------------------------------
> 
> The proposed replacement code:
> 
> ----------------------------------------------------------------------
> 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 {} + \)
> ----------------------------------------------------------------------

This is for sure an improvement!

I personally like the following(already well known i think) solution the 
most, which i believe does the same.
It's super fast and doesn't follow symlinks:

chmod -R u+w,go-w,a+rX-st .


More information about the SlackBuilds-users mailing list