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


/ Published in: Bash
Save to your folder(s)

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).


Copy this code and paste it in your HTML
  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 {} \;

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.