LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-21-2003, 01:17 PM   #1
vrillusions
Member
 
Registered: Feb 2003
Location: Ohio, USA
Distribution: Ubuntu, Debian, CentOS
Posts: 99

Rep: Reputation: 25
chmod directories only


I have a lot of directories that I want to chmod, but only the directories, not the files. Alot of them are nested, so I can't just chmod the directory and then set the files back to what they were before.

I tried using ls -Rd * to see if that would list all the direcotories (thinking I could pipe it to chmod command) and it only lists the directories in the current directory, it doesn't recurse through them, even though I specify the R tag.

Any other ideas? Thanks. This is on Mandrake 9.1
 
Old 05-21-2003, 01:25 PM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Maybe write a small shell script instead of that one line piped command?
 
Old 05-21-2003, 01:28 PM   #3
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
find . -type d -exec chmod 000 {} \;
 
Old 05-21-2003, 07:58 PM   #4
vrillusions
Member
 
Registered: Feb 2003
Location: Ohio, USA
Distribution: Ubuntu, Debian, CentOS
Posts: 99

Original Poster
Rep: Reputation: 25
Quote:
Originally posted by whansard
find . -type d -exec chmod 000 {} \;
Thanks, that worked perfectly.
 
Old 05-21-2003, 08:02 PM   #5
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
you betchum red ryder
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CHMOD directories.sub-directories.files zerojosh Linux - Software 2 11-19-2005 03:22 PM
chmod to only change directories lluciano Linux - General 2 08-17-2005 02:14 PM
How to chmod -R on directories only? jdupre Linux - Newbie 3 11-12-2004 11:45 PM
Using chmod on directories rob19 Linux - Newbie 4 07-10-2004 04:37 AM
Cannot Chmod directories stelmed Slackware 4 05-19-2003 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:35 AM.

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