Fedora Linux Support Community & Resources Center
  #1  
Old 12th November 2004, 01:20 PM
RedFedora's Avatar
RedFedora Offline
Registered User
 
Join Date: May 2004
Posts: 503
Changing permisions

I have an odd problem that I'm hoping you can help me with.
I have a large directory tree filled with thousands of files and sub-directories.
What I would like to do is make all of the files in this tree read-writeable, but
non-executable. I would like to make the directories executable (enterable?)
as well as readable.
Normally, I would use chmod with the recursive flag for this, but since the directories
and files should have different permissions, I don't want to do it that way.

Can someone suggest a way to use chmod and ... I dunno, find?, to set different
permissions on directories and files in a tree?
Reply With Quote
  #2  
Old 12th November 2004, 07:20 PM
crackers's Avatar
crackers Offline
Retired Community Manager
 
Join Date: Feb 2004
Location: Seattle, WA, USA
Age: 56
Posts: 3,423
Yup, like this:
Code:
# find dirname -type d -exec chmod a+x {} \;
# find dirname -type f -exec chmod a+rw {} \;
Note that this shouldn't change the execute bits on any executable files in the tree because you're "adding" permissions (the "+").
__________________
Linux User #28251 (April '93)
Professional Java Geek :cool:
Reply With Quote
  #3  
Old 13th November 2004, 03:17 AM
RedFedora's Avatar
RedFedora Offline
Registered User
 
Join Date: May 2004
Posts: 503
find + chmod

Crackers, thanks a lot. That worked perfectly. My stumbling block before was not knowing how to use the find "type" argument, I think.
Reply With Quote
  #4  
Old 13th November 2004, 06:08 AM
crackers's Avatar
crackers Offline
Retired Community Manager
 
Join Date: Feb 2004
Location: Seattle, WA, USA
Age: 56
Posts: 3,423
Heck, I didn't even figure out how to use the "-exec" flag properly until this year... :o
__________________
Linux User #28251 (April '93)
Professional Java Geek :cool:
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare File Permisions of two diferent machines joangopan Security and Privacy 0 11th September 2007 04:43 AM
Changing Permisions (Simple How to) rabalam Using Fedora 7 12th December 2006 08:29 PM
Permisions for networking for non "root" users HammerPuffin Security and Privacy 1 24th October 2006 12:19 AM
Help Set Permisions to Samba please.. kerveros Servers & Networking 2 23rd September 2005 09:53 AM
desktop permisions eutu Using Fedora 2 21st February 2005 02:20 PM


Current GMT-time: 00:20 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat