Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 5th September 2008, 07:54
dealspiggy dealspiggy is offline
Join Date: Mar 2008
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to chmod php files without chmod subdirectory?

When there are several layers of subdirectories in a main subdirectory (e.g. main/subdir1/subdir2/subdir3/) and each subdirectory has many php files, I wonder how to chmod those php files to 644 without chmoding subdirectories?

chmod -R 644 main ?? But this also chmod subdirectories to 644, how do I add a condition to this chmod ?
Reply With Quote
Sponsored Links
Old 5th September 2008, 09:14
daveb daveb is offline
Senior Member
Join Date: Dec 2006
Location: St Louis Mo
Posts: 272
Thanks: 43
Thanked 41 Times in 37 Posts

To chmod all your files below a dir to 644 use this:
find /path/to/dir/ -type f -print0 | xargs -0 chmod 644
if you want to chmod all sub dir below a dir to say 755 try this
find /path/to/dir/ -type d -print0 | xargs -0 chmod 755
Reply With Quote


Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 18:26
File Permissions demonize Installation/Configuration 0 26th June 2008 21:11
ispconfig php 5 errors itamarjp Installation/Configuration 8 25th April 2008 11:20
network issues now it says "401 The web site is blocked by administrator" Check General 3 26th February 2008 15:22
Apache2 Freezes celtic Server Operation 31 28th May 2007 18:18

All times are GMT +2. The time now is 13:34.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.