755 all folders and 644 all files

Posted in Mac, linux, macbook, resource, tips, unix on Jul 25, 2008

I usually need to change permissions of files and folders on our servers or on my Mac, in order to execute software correctly. Most cases, folders should have 755, files should have 644 permissions. It’s not possible to do that one by one, therefore I usually need some unix / OSX commands to do that. And figured out whenever I need this (almost every week), I figure out I try to search the Internet. So here is the magic code; so we all know where to find it when we need it again :)

chmod -R 755 *
find -type f -print0|xargs -0 chmod 644

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • Technorati
  • email
  • Facebook
  • Furl
  • Google Bookmarks
  • LinkedIn
  • Mixx
  • Netvouz
  • NewsVine
  • Pownce
  • Reddit
  • StumbleUpon
  • TwitThis

Trackback URI | Comments RSS

One Response to “ 755 all folders and 644 all files ”

  1. # 1 Rahul J Says:

    Excellent!! THANKS … was just looking for this. separating out file and folder permission on a tree. :)

Speak your peace!