LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 07: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, 07:29 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

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

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


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using chmod to recursively change directories / files [GOD]Anck Linux - Software 6 11-10-2008 07:16 PM
Recursively chmod directories simonx Linux - Newbie 6 10-31-2007 02:01 PM
chmod directories recursively mfilippa Linux - Newbie 3 04-17-2006 08:24 PM
chmod to only change directories lluciano Linux - General 2 08-17-2005 03:14 PM
Why doesn't a wildcard chmod change "dot" files/directories? jht2k Linux - General 1 08-09-2004 03:31 PM


All times are GMT -5. The time now is 07:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration