グループ権限をユーザー権限と同じにする

グループ権限をユーザー権限と同じにする

特定の親ディレクトリ内のすべてのファイルとサブディレクトリのグループ権限を、その特定のファイルまたはディレクトリのユーザー権限設定に設定したいと思います。

たとえば、以下の内容はすべて/path/to/parentdir

# Permissions before
# Path                      Permissions
/path/to/parentdir/file1    755
/path/to/parentdir/file2    644
/path/to/parentdir/file3    600

# Permissions after
/path/to/parentdir/file1    775
/path/to/parentdir/file2    664
/path/to/parentdir/file3    660

1つのコマンドでこれを簡単に実行できたらと思います。複数のコマンドを含むスクリプトを使用する方法を理解できますが、これを行うには非常に直接的な方法が必要です。

よろしくお願いします!

ベストアンサー1

これがあなたが望むものです:

chmod -R g=u directory

おすすめ記事