Mass reset of POSIX permissions on directories or files.

January 10th, 2011 by Oliver Helm Leave a reply »

These two nifty commands allow you to set separate permissions on files or directories within a document root on POSIX based file systems such as linux or Mac OS X with a single comment. They’re an invaluable tool in any web developers arsenal!

To reset the permissions on all files within a document root you can run from the command:

find . -type f -exec chmod 644 {} \;

Or for all directories (files) within the document root:

find . -type d -exec chmod 755 {} \;

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • StumbleUpon
  • Twitter
  • email
  • Google Bookmarks
Advertisement

Leave a Reply

Comment Spam Protection by WP-SpamFree