0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

パーミッション(chmod)について

Posted at

アルファベットの意味

※ r w x を覚えて足し算すれば、OK。

アルファベット ビット値 権限
r 4 読み出し可能
w 2 書き込み可能
x 1 実行可能
- 0 権限なし
rw 6(4+2) 読み&書き可能
rwx 7(4+2+1) 全て許可
r-x 5(4+1) 読み&実行可能

llコマンド

.bash

$ ll

:
:
lrwxrwxrwx.  1 root   root       14  9月 19  2019 redhat-release -> centos-release
-rw-r--r--   1 root   root      269  6月  4 10:50 resolv.conf
-rw-r--r--.  1 root   root     1634 12月 25  2012 rpc
drwxr-xr-x.  2 root   root     4096  2月 28  2020 rpm
:
:

先頭文字

アルファベット 意味
d フォルダ
- ファイル
l シンボリックリンク

読み解いてみる!!!

d rwx r-x r-x .

フォルダ

d rwx r-x r-x .

所有者 に与えられた権限
全て許可

drwx r-x r-x .

所有グループ に与えられた権限
読み込みと実行のみ許可

d rwx r-x r-x .

その他全員 に与えられた権限
読み込みと実行のみ許可

drwxr-xr-x. 2 root root 4096 2月 28 2020 rpm

所有者はroot

drwxr-xr-x. 2 root root 4096 2月 28 2020 rpm

所有グループはroot

drwxr-xr-x. 2 root root 4096 2月 28 2020 rpm

データサイズ(4096バイト)

chmodコマンド

.bash

# chmod モード 対象のファイル名
chmod 755 file.txt

-rwxr-xr-x

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?