Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing file and directory permissions - A little help needed!

Status
Not open for further replies.

McQueen

Technical User
Feb 13, 2003
55
GB
Hi all,

I've copied a few directories from a windows server to my Solaris box using root to do it. I've changed the owner and group of the file and directory using chown (chown -R smcqueen:datadev directory_name) but I need to change the file and directory permissions. The permissions need to be

directory rwxrwx--x
files = rw-rw----

Is there a command or script I can use to recurse down a directory changing only the directories to rwxrwx--x then run the same commend or script to change the files to rw-rw-r--

Thanks for all your help


McQueen
 
Hi. You may like to try:

find /path/to/directory -type d -exec chmod 771 {} \;

for directories, and;

find /path/to/directory -type f -exec chmod 664 {} \;

for files

I have assumed that you require rw-rw-r-- for files since you seem to have two options above (the first rw-rw---- would be 660).

All I ask of you is make my wildest dreams come true
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top