The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to change permissions in a certain directory? praveen_indramo UNIX for Dummies Questions & Answers 1 03-25-2008 09:07 AM
Directory Default Permissions prvnrk UNIX for Advanced & Expert Users 4 10-18-2007 09:22 PM
permissions of a directory smehra UNIX for Dummies Questions & Answers 3 06-04-2006 07:32 AM
determine owner directory permissions from within the directory Sniper Pixie Shell Programming and Scripting 4 03-07-2006 02:06 PM
directory permissions and CHMOD ncarmstrong UNIX for Dummies Questions & Answers 3 08-14-2002 10:00 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-04-2008
Registered User
 

Join Date: Apr 2008
Posts: 2
Recusive Directory Permissions with Spaces

Ok, I think it would be wise to begin with the scenario.

I've got a server that has a template directory structure containing 7 folders. Some folders will need permissions set one way, and other set another way. That's the easy part using:

chmod -R 755 * ;This used first to cover majority

To change permissions on specific directories, I've used the following:

find ./ -type d -name dirname | xargs chmod 775

Works great until I have a directory with a space. IE:"Print Production"

I've done the following and successfully found such directories with:

find ./ -type d -name Print*' '*Production -print

Tried running this to change permissions:

find ./ -type d -name Print*' '*Production | xargs chmod 775

This is what I get in response to running the command:

chmod: .//YOU99752/YOU/20681/Print: No such file or directory
chmod: Production: No such file or directory

As you can see here, it seems to be trying to apply permission to "Print" and "Production" subdirectories. I can chmod in the root folder for "Print Production and change permissions, but with over 6000+ subdirectories, I really don't have the time (or patience) to go through each directory as would anyone.

Any help would be appreciated.

Thanks
JB
Reply With Quote
Forum Sponsor
  #2  
Old 04-04-2008
Registered User
 

Join Date: May 2007
Location: Roanoke, VA
Posts: 11
Does this help? Worked for me.

Code:
find . -type d -name "Print\ Production" -exec chmod -R 775 '{}' \;
Reply With Quote
  #3  
Old 04-04-2008
Registered User
 

Join Date: Apr 2008
Posts: 2
Perfectly!

Thanks,
-JB



Quote:
Originally Posted by blane View Post
Does this help? Worked for me.

Code:
find . -type d -name "Print\ Production" -exec chmod -R 775 '{}' \;
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0