LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2010, 06:23 PM   #1
flokip
LQ Newbie
 
Registered: Aug 2009
Posts: 21

Rep: Reputation: 0
chmod change olny directories recursively


Is it possible to change only directories access permissions recursively with some linux command.
I need to set x ( access )permissions on directories but not execute on files.

PS
http://linux.die.net/man/1/chmod
chmod - change file access permissions

-R, --recursive
change files and directories recursively
 
Old 03-28-2010, 06:29 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Use find cmd with -type d to feed into chmod http://linux.die.net/man/1/find
 
Old 03-28-2010, 06:30 PM   #3
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Code:
shell# find /some/folder -type d -exec chmod <blah-blah> "{}" \;

The above should work fine enough.

Replace /some/path with whatever is the start directory to recurse into; replace <blah-blah> with whatever read/write/whatever permission(s) you wish (refer to the chmod man page).

-type d ... this means find items of the type "directory" (refer to the `find` manpage for full details).

chrism01 neat me to it -- well, there you have it.

Sasha
 
  


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
Using chmod to recursively change directories / files [GOD]Anck Linux - Software 6 11-10-2008 06:16 PM
Recursively chmod directories simonx Linux - Newbie 6 10-31-2007 01:01 PM
chmod directories recursively mfilippa Linux - Newbie 3 04-17-2006 07:24 PM
chmod to only change directories lluciano Linux - General 2 08-17-2005 02:14 PM
Why doesn't a wildcard chmod change "dot" files/directories? jht2k Linux - General 1 08-09-2004 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:26 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