Subject: bug#30477: [PATCH] chmod chown chgrp: added --exclude-files and --exclude-directories

From: Assaf Gordon <[email-masked]>
Date: Fri, 16 Feb 2018 15:16:19 -0700

Hello Ian,

On Thu, Feb 15, 2018 at 07:44:39PM -0500, Ian Morris Nieves wrote:
> Attached please find a new feature I created to simplify setting permissions (especially recursively), which enables the user to separately target files or directories.

Can you provide a concrete example/scenario where this is needed,
and find/xargs are not sufficient ?

For example, to apply chmod/chown/chgrp on files alone
(like your --exclude-directories), one can use:

  find $DIR -type f | xargs chmod [NEWMODE]

And of course, find's predicates can be expanded to include
symlinks, sockets and other conditions, and using -print0 for
safer execution.

regards,
 - assaf