▼すべてを開く。
▲すべてを閉じる。
$ ls -l -rwxrwxrwx 1 masa users 256 5月 19 19:00 file
$ chmod o=r file
chmodコマンドで、その他のグループを示す「o」に特定の権限だけの設定を示す「=」そして読み込み「r」対象ファイル名「file」を指定すると、その他のグループのファイル「file」に対するアクセス権が読み込み可だけに設定される。
コマンド実行結果をリストで見る$ ls -l -rwxrwxr-- 1 masa users 256 5月 19 19:00 file
$ ls -l drwxr-x--x 2 masa users 4096 5月 20 17:50 dir1
$ chmod o+r dir1
chmodコマンドで、その他のグループを表す「o」に読み込み権の付加を表す「+r」対象ディレクトリ名「dir1」を指定すると、ディレクトリ「dir1」にその他のグループの読み込み許可が設定される。
lsコマンドで実行結果を見る$ ls -l drwxr-xr-x 2 masa users 4096 5月 20 17:50 dir1
$ ls -l -rwxr----- 1 masa users 268 6月 3 21:48 myfile1
$ chmod o+r myfile1
chmodコマンドで、その他のグループを示す「o」に読み込み権の付加を表す「+r」対象ファイル名「myfile1」を指定すると、ファイル「myfile1」にその他のグループの読み込み許可が設定される。この例では、ユーザ「masa」はグループ「users」に属しているので、このグループに属するユーザ以外のユーザがファイルを読むことができるようになる。
lsコマンドで実行結果を見る$ ls -l -rwxr--r-- 1 masa users 268 6月 3 21:48 myfile1