My Science Is Better

19Jan/092

Chmod only files or chmod only folders

I moved the blog the a new server and i realised that all the permissions got screwed up on the process. All files and folders were having chmod 777, and that's not exactly ideal. After digging a bit on google on how to chmod only files or chmod only folders, i came up with this:

1. Recursive chmod only files within this folder:
find . -type f -exec chmod 0600 {} ;

2. Recursive chmod only folders within this folder:
find . -type d -exec chmod 0755 {} ;

Hope this helps!

Comments (2) Trackbacks (0)
  1. it should be:
    find . -type d -exec chmod 0755 {} \;

  2. Useful, thanks. (the \; mentioned above worked for me)


Leave a comment


No trackbacks yet.

Tag Cloud

Categories

Archives

Akismet

Blogroll

Ads