LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 10-03-2005, 10: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, 10:45 PM   #2
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Code:
chmod -R
Code:
man chmod
 
Old 10-03-2005, 10: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-03-2005 at 11:08 PM.
 
Old 10-03-2005, 11:43 PM   #4
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
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



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



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 05:23 AM
chmod whole directory waynejkruse10 Linux - Software 5 08-31-2005 04:57 PM
Cannot set chmod for directory to 777 or 666 q.sa Linux - Software 6 07-19-2005 09:36 AM
did chmod 666 on a directory but it doesn't work r3dhatter Linux - Newbie 6 06-10-2005 10:06 AM
chmod for a group on a certain directory? mfeoli Linux - Newbie 1 02-10-2004 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration