11
13

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 5 years have passed since last update.

chmodで設定する権限の書き方

Posted at

chmod [権限] [FileName]

[権限]は「ユーザーと権限を指定するもの」と「数字表記」2通りの書き方がある。

ユーザーと権限を指定するもの

[誰に][どんなふうに][どの権限を]

  • 誰に u(ser), g(roup), o(thers), a(ll)
  • どんなふうに +, -, =
  • どの権限を r, w, x

ex)

chmod u+x hoge.sh
chmod a+w index.html

数字表記

[所有者][グループ][その他]

  • 権限によってポイントが積み上がる
  • r = 4
  • w = 2
  • x = 1

読出・書込・実行が可能であれば 4+2+1=7
読出・実行が可能であれば 4+1=5
読出のみなら 4 ...とかそんなかんじ

ex)

chmod 744 hoge.sh
chmod 655 index.html

いつもパッと頭に浮かんでこないのでまとめておく

11
13
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
11
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?