Introduction

A couple of pretty simple bash commands for finding and changing permissions on all files and directories recursively. Obviously you need to understand what permissions you want in advance so check the man pages and online but for when you find a load of files and directories have wrong permissions. Makes life easy, especially when directories are nested deeply.

Commands

find <path>/ -type d -not -perm 775 -exec chmod 755 {} \;
find <path>/ -type f -not -perm 664 -exec chmod 644 {} \;
Find and Change All Permissions Recursively
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.