Recusive Directory Permissions with Spaces


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Recusive Directory Permissions with Spaces
# 1  
Old 04-04-2008
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
# 2  
Old 04-04-2008
Does this help? Worked for me.

Code:
find . -type d -name "Print\ Production" -exec chmod -R 775 '{}' \;

# 3  
Old 04-04-2008
Perfectly!

Thanks,
-JB



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

Code:
find . -type d -name "Print\ Production" -exec chmod -R 775 '{}' \;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Backup files recusive

Hi, I have folder , backup , with sub-folders Jan , Fev , Mar , witch also have sub-folders How can i recursivelly compress this files , in each folder grouped by month? (2 Replies)
Discussion started by: prpkrk
2 Replies

2. UNIX for Dummies Questions & Answers

Directory permissions

i have an application that writes to a directory. let's call the directory: /var/app/ the permissions of this directory is: drwxrwxr-x Now the files that the application creates in this directory usually dont have read permissions for others. i know there's something called... (3 Replies)
Discussion started by: SkySmart
3 Replies

3. Solaris

Directory Permissions for 2 users on 1 directory

we want to allow user to FTP files into a directory, and then the program (PLSQL) will read and process the file, and then move the file to other directory for archiving. the user id: uftp1, group: ftp the program run in oracle database, thus have the user Id: oraprod, group: dba how to... (2 Replies)
Discussion started by: siakhooi
2 Replies

4. UNIX for Dummies Questions & Answers

changing directory permissions

Hi, Im getting this annoying problem on file permission when I copy a folder to a mounted external directory. the files inside the copied folders become all executable. I tried to search for ways how to undo the permission over the web but to no avail. tried this one but it doesnt change a... (2 Replies)
Discussion started by: ida1215
2 Replies

5. Shell Programming and Scripting

Checking directory permissions on UNIX directory

Hi, How do i check if I have read/write/execute rights on a UNIX directory? What I'm doing is checking read access on the files but i also want to check if user has rights on the direcory in whcih these files are present. if then...... And I check if the directory exists by using... (6 Replies)
Discussion started by: chetancrsp18
6 Replies

6. UNIX for Dummies Questions & Answers

Directory Permissions

Hi all. Only one of the following makes any kind of sense as a possible permission field for a UNIX file. Which one? --w------- ----rwxrwx -r-------- --rwx----- ----r----- I think it is no. 3. I dont think it would be 2, because why would you want to give groups and... (1 Reply)
Discussion started by: hawaiifiver
1 Replies

7. UNIX for Dummies Questions & Answers

unix directory permissions

Hi All I am using cygwin and if i type ls -l it is giving like drwxr-xr-x+ for directories. My question is what is the meaning of '+' sign at the end? its not giving that '+' sign for files. Thank you (1 Reply)
Discussion started by: Usha Shastri
1 Replies

8. UNIX for Dummies Questions & Answers

permissions of a directory

Read and write bits make sense for a directory but what about the execute permission bit What does that imply?Is it just a filler? Saurabh (3 Replies)
Discussion started by: smehra
3 Replies

9. Shell Programming and Scripting

determine owner directory permissions from within the directory

From within a directory, how do I determine whether I have write permission for it. test -w pwd ; echo ? This doesn't work as it returns false, even though I have write permission. (4 Replies)
Discussion started by: Sniper Pixie
4 Replies

10. UNIX for Dummies Questions & Answers

directory permissions and CHMOD

I am working on a new UNIX box that has been delivered to us, and noticed that the /home directory has 555 permissions on it (dr-xr-xr-x). Any attempt to create write permissions fails on this directory (such as chmod 777), responding only with a message; chmod: WARNING: can't change home ... (3 Replies)
Discussion started by: ncarmstrong
3 Replies
Login or Register to Ask a Question