find + chmodでパーミッションの一括変更 2006.03.20 Webマスター Webサーバ上のファイルのパーミッション(アクセス権)を一括で変更したい。ということがよくある。 ■一括で、public_html以下のファイルを644へ変更する $ find public_html -type f -print | xargs chmod 644 または、 $ find public_html -type f -exec chmod 644 {} \; ■一括で、public_html以下のディレクトリを755へ変更する $ find public_html -type d -print | xargs chmod 755 または、 $ find public_html -type d -exec chmod 755 {} \; ■SGID(グループIDのs)をとる $ ls -l
![find + chmodでパーミッションの一括変更](https://cdn-ak-scissors.b.st-hatena.com/image/square/3ea603abc6c2d08c8bf255963a0f896e3a527faf/height=288;version=1;width=512/http%3A%2F%2Fext.omo3.com%2Fwp-content%2Fuploads%2F2019%2F07%2F2019-07-WebMaster.gif)