LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 10-03-2005, 11:29 PM   #1
ycamera2mank
LQ Newbie
 
Registered: Sep 2005
Posts: 5

Rep: Reputation: 0
chmod directory help


This might be kind of a newb question for chmod, but how do you chmod a whole directory?

I am running apache 2 on my fedora core 3 machine, and i don't want folders like "images/" to be seen. Yet this isn't the only one I don't want to be viewed. I am aware of the
Code:
chmod 711 directory
, but it only does that specific directory, it doesn't do the folders in that directory. So is there anyway I can chmod 711 a whole directory? And if I make a new folder, that will also be the 711 permission?

If someone could help me out, that would be greatly appreciated, thanks.

-Asim
 
Old 10-03-2005, 11:45 PM   #2
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 45
Code:
chmod -R
Code:
man chmod
 
Old 10-03-2005, 11:50 PM   #3
ycamera2mank
LQ Newbie
 
Registered: Sep 2005
Posts: 5

Original Poster
Rep: Reputation: 0
actually, I was looking for something that wouldn't affect the actual files, just the folders, w/ chmod -R, all the files (even the images) are non executable. Is there an option to just do folders? or will I have to do it the hard way?

Last edited by ycamera2mank; 10-04-2005 at 12:08 AM.
 
Old 10-04-2005, 12:43 AM   #4
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 45
OK - give this a shot (will probably need edited, but this is a start):
Code:
for dir in `find /path/to/directory -type d -name *`; do chmod 711 $dir; done
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What effect has chmod 222 on a directory? JZL240I-U Linux - Software 11 09-13-2005 06:23 AM
chmod whole directory waynejkruse10 Linux - Software 5 08-31-2005 05:57 PM
Cannot set chmod for directory to 777 or 666 q.sa Linux - Software 6 07-19-2005 10:36 AM
did chmod 666 on a directory but it doesn't work r3dhatter Linux - Newbie 6 06-10-2005 11:06 AM
chmod for a group on a certain directory? mfeoli Linux - Newbie 1 02-10-2004 06:13 PM


All times are GMT -5. The time now is 09:37 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration