I need to know how to apply a CHMOD command to only files that have a specific name recursively?
chmod 755 -R filename
Something like above but it should apply to any filename
that exists in any sub folders.
bashcommand-line-interfacelinuxUbuntu
I need to know how to apply a CHMOD command to only files that have a specific name recursively?
chmod 755 -R filename
Something like above but it should apply to any filename
that exists in any sub folders.
Best Answer
This will find all files named filename, recursively from the current directory, and pass them to
chmod
.See the manpages for
find
andxargs
for more advanced options. In particular, look at the-print0
flag and corresponding-0
toxargs
if you get errors about files with spaces in the name.