Unix administration - smart chmod?

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > September 2006 > smart chmod?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author smart chmod?
Jim Showalter

2006-09-16, 1:43 pm

I copied a large directory containing thousands of files and with many
sub-directories from a fat32 drive to a ReiserFS drive. All the files
are now world executable.

Is there a way, using "chmod -R", to do a blanket removal of the
execute permission on normal files, while leaving the 'x' permission
on sub-directories?

--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Everything should be made as simple as possible, but not simpler.
_/ -- Albert Einstein
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Chris F.A. Johnson

2006-09-16, 1:43 pm

On 2006-09-14, Jim Showalter wrote:
> I copied a large directory containing thousands of files and with many
> sub-directories from a fat32 drive to a ReiserFS drive. All the files
> are now world executable.
>
> Is there a way, using "chmod -R", to do a blanket removal of the
> execute permission on normal files, while leaving the 'x' permission
> on sub-directories?


chmod -R -- a-x *
find * -type d -exec chmod +x {} \;

--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
Hans Peter Smyk

2006-09-16, 1:43 pm

Jim Showalter wrote:
> I copied a large directory containing thousands of files and with many
> sub-directories from a fat32 drive to a ReiserFS drive. All the files
> are now world executable.
>
> Is there a way, using "chmod -R", to do a blanket removal of the
> execute permission on normal files, while leaving the 'x' permission
> on sub-directories?
>


find ./ -type f | xargs chmod a-x
Jim Showalter

2006-09-16, 1:43 pm

Thanks Chris - thanks Hans! I knew there'd be a way, but wasn't even aware
of the type command.

--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Everything should be made as simple as possible, but not simpler.
_/ -- Albert Einstein
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com