How to change file & folder permissions recursively in Linux

November 16th, 2008 Categories: Linux, cPanel

Often times it’s necessary to change the permissions on many files & folders recursively – i.e. change the permisssions on every file & folder.

Todo so, login to your Server via SSH, and run the following commands as root.

1
2
3
 
find /home/username/public_html/ -type d -exec chmod 755 {} \;
find /home/username/public_html/ -type f -exec chmod 644 {} \;

The first line will change all folders (the “d” specifies directory) to mode 755
The second line will change all files to mode 644.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis
Tags:
No comments yet.
You must be logged in to post a comment.