Linux 標準教科書 Ver.1

Page 124

7 章 ユーザ権限とアクセス権 みが可能で、W が表示されればファイルの書き込みが可能です。X が表示されればファイルをプログラム として実行できるか、または、ディレクトリであればディレクトリへ移動できます。

実習:ファイル所有グループの確認 ファイルのモードを確認してください。 システムのディレクトリのモードを確認してください。 $ ls -l .bashrc ↵ -rw-r--r-- 1 penguin linux 124 2 月 6 02:44 .bashrc # 所 有 者 が 読 み 書 き , 所 有 グ ループが読み,その他が読み $ ls -l /usr 合計 272 # /usr ディレクトリにあるディレクトリは全てのユーザが読み実行可能で所 有者(root)が書き込み可能 drwxr-xr-x 3 root root 4096 2 月 6 01:45 X11R6 drwxr-xr-x 2 root root 4096 2 月 8 13:07 arc drwxr-xr-x 2 root root 69632 2 月 9 04:02 bin drwxr-xr-x 2 root root 4096 3 月 30 2007 etc drwxr-xr-x 2 root root 4096 3 月 30 2007 games drwxr-xr-x 84 root root 12288 2 月 6 02:04 include drwxr-xr-x 6 root root 4096 11 月 11 11:39 kerberos drwxr-xr-x 108 root root 69632 2 月 7 11:41 lib drwxr-xr-x 13 root root 4096 2 月 9 04:02 libexec drwxr-xr-x 11 root root 4096 2 月 6 01:43 local drwxr-xr-x 2 root root 16384 2 月 7 11:41 sbin drwxr-xr-x 226 root root 12288 2 月 6 02:05 share drwxr-xr-x 5 root root 4096 2 月 6 08:52 src lrwxrwxrwx 1 root root 10 2 月 6 01:43 tmp -> ../var/tmp

7.2.2 ファイルのモード変更 ファイルのモードを変更するには chmod コマンドを使います。

書式 chmod モード[,モード]... ディレクトリ chmod モード[,モード]... ファイル chmod 8 進数表記のモード ディレクトリ chmod 8 進数表記のモード ファイル ファイルのモードを所有ユーザと所有グループとそれ以外のユーザについて設定します。 モード指定の書き方で次の 2 通りの記述方法があります。

7-114


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.