Posted By

nkm on 08/25/13


Tagged

file folder recursive chmod change permissions


Versions (?)

Recursively Change File Permissions on Files/Folders Only [*nix]


 / Published in: Bash
 

URL: http://randomtechsolutions.wordpress.com/2010/05/25/recursively-change-file-permissions-on-folders-only-linuxunix/

Problem

You want to recursively change all of the file permissions only on folders & subfolders in a directory, but not the files (or vice-versa: you want to change the permissions on files only, not folders).

  1. # This command will recursively search your current directory and chmod all directories & sub-directories only:
  2. find . -type d -exec chmod 755 {} \;
  3.  
  4. # The following command will chmod all files only (ignoring the directories):
  5. find . -type f -exec chmod 644 {} \;

Report this snippet  

You need to login to post a comment.