Saturday, January 1, 2022

Recursive directory and file permissions in Linux

Sometimes I need to set permissions on a bunch of files and directories which are inside another directory. This is how I do it. These are two separate commands, one on each line.

find <path to whatever> -type d -exec chmod 0755 {} \;

find <path to whatever> -type f -exec chmod 0644 {} \;