3
2

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.

drwxrwxrwx って結局なんなの?

Last updated at Posted at 2021-12-03

drwxrwxrwx

$ chmod 777 directory_name
$ ls -l

とやると、ディレクトリの左がこうなるけど、結局いまいち
なんなのか、どれだったら正解なのか、よく分かってない。

「777 は駄目だ!危険だ! 755とか754とか751にしなさい」
って先輩に言われたのでやってみると

$ chmod 755 directory

drwxr-xr-x

なにが変わったんだろう?よくわからんなって思った時に読んでね。

区切り方

「d」「rwx」「rwx」「rwx」と区切る

最初の「d」 は「これはディレクトリ」って事です。

最初が「-」(ハイフン)だったら、それはファイルです。

その後の rwx が「r=読む」「w=書く」「x=実行」
順番はこのようになっています。

「d」「自分」「グループ」「全員」

MacのFinderの「情報を見る」と同じです。

数字との関連性

7 = rwx

6 = rw-

5 = r-x

4 = r--

1 = --x

chmod 777 で全員が読み書き実行できる。なるほど危険だ。

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?