Posted By

beneberle on 07/03/10


Tagged

unix permissions


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Vordreller


UNIX: Recursive chmod Directories or Files


 / Published in: Bash
 

  1. // This will recursively search your directory tree (starting at dir 'dot') and chmod 755 all directories only.
  2. find . -type d -exec chmod 755 {} \;
  3.  
  4. // Similarly, the following will chmod all files only (and ignore the directories):
  5. find . -type f -exec chmod 644 {} \;
  6.  
  7. // Change files of only a specific type/extension (pdf in this case):
  8. find ./ -name *.pdf -exec chmod 755 {} \;

Report this snippet  

You need to login to post a comment.