LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-14-2005, 02:03 PM   #1
ojbyer@usa.net
LQ Newbie
 
Registered: Dec 2005
Posts: 11

Rep: Reputation: 1
using chmod -R to set different permissions for files vs. directories


Initially, I thought I wanted to to reset all files in a directory tree to 660 permissions. After issuing the command:

chmod -r 660 some_directory

I soon discovered that I actually wanted to set all the files to 660 and the directories to 770.

Is there an easy way to accomplish this other than manually?

Last edited by ojbyer@usa.net; 12-14-2005 at 02:12 PM. Reason: make title more clear
 
Old 12-14-2005, 02:15 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Code:
chmod -r 660 some_dir
chmod -r ug+X some_dir
 
Old 12-14-2005, 02:19 PM   #3
ojbyer@usa.net
LQ Newbie
 
Registered: Dec 2005
Posts: 11

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Matir
Code:
chmod -r ug+X some_dir
Isn't this the same thing as

chmod -R 770 some_dir

I don't want all the files to have execute permissions, only the directories.
 
Old 12-14-2005, 02:38 PM   #4
EyesOnly
Member
 
Registered: Aug 2003
Location: The Netherlands
Distribution: SlackWare
Posts: 202

Rep: Reputation: 30
To make directories recursevly executable(and directories only), I always use the following command
Code:
find * -type d -exec chmod +x {} \;
 
Old 12-15-2005, 07:24 PM   #5
ojbyer@usa.net
LQ Newbie
 
Registered: Dec 2005
Posts: 11

Original Poster
Rep: Reputation: 1
Thanks for both answers. I found out each one works, for the first the capital "X" is the key.
 
  


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
Setting permissions sammckee Linux - Newbie 9 09-18-2003 05:01 PM
setting permissions Tigger Linux - Security 1 06-09-2003 09:20 AM
Setting Permissions johnnyde Linux - Newbie 1 05-22-2003 04:37 PM
Setting Permissions mythology Slackware 2 12-11-2002 02:14 AM
Setting up permissions rajaram Linux - Newbie 2 12-05-2001 02:55 PM

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

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