LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   chmod directory help (https://www.linuxquestions.org/questions/linux-software-2/chmod-directory-help-369552/)

ycamera2mank 10-03-2005 10:29 PM

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

scuzzman 10-03-2005 10:45 PM

Code:

chmod -R
Code:

man chmod

ycamera2mank 10-03-2005 10:50 PM

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?

scuzzman 10-03-2005 11:43 PM

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


All times are GMT -5. The time now is 04:43 AM.