Thursday, February 2, 2012

Apply Commands Only to All Files or Directories

Choose "type" to be "d" (directory) or "f" (file).
find . -type "type" -exec chmod 755 {} \; 
find . -type "type" -exec chown owner.group {} \;

More generally, any "command" will work, too.
find . -type "type" -exec "command" {} \;

No comments:

Post a Comment