# Mass change of file permissions in Linux, BSD and MAC

Source: https://www.hukot.net/community/en/tutorials/mass-change-of-file-permissions-in-linux-bsd-and-mac
Updated: 2018-05-25

Performing a bulk change of permissions, owner, and group for files and directories in Linux is not a problem. If you only need to apply this to files within a specific directory and its subdirectories, a single command won't be enough.

Here's a concise and functional guide:

##### Solution for directories and subdirectories:

`find ./directory -type d -print0 | xargs -0 chmod 755`

##### Solution for files:

`find ./directory -type f -print0 | xargs -0 chmod 644`

This also works for changing the group or owner. You just need to replace "**chmod**" with "**chgrp**" for changing the group and "**chown**" for changing the owner.
