smart chmod?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > smart chmod?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    smart chmod?  
Jim Showalter


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-16-06 06: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
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/





[ Post a follow-up to this message ]



    Re: smart chmod?  
Chris F.A. Johnson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-16-06 06: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





[ Post a follow-up to this message ]



    Re: smart chmod?  
Hans Peter Smyk


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-16-06 06: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





[ Post a follow-up to this message ]



    Re: smart chmod?  
Jim Showalter


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-16-06 06: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
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:01 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register