0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Mac】duコマンドの使い方

Posted at

duコマンドを使用するとファイルやディレクトリのサイズを確認できます。

ディレクトリとサブディレクトリのサイズを指定した単位 (KiB/MiB/GiB) で一覧表示

du -k|m|g path/to/directory

ディレクトリとサブディレクトリのサイズを人間が読める形式で一覧表示

du -h path/to/directory

単一のディレクトリのサイズを人間が読める単位で表示

du -sh path/to/directory

特定のディレクトリとその中にあるすべてのファイルとディレクトリのサイズを人間が読める単位で表示

du -ah path/to/directory

ディレクトリとその中にあるすべてのファイルとディレクトリの人間が読めるサイズを指定したレベルまで表示

du -h -d 2 path/to/directory

現在のディレクトリのサブディレクトリにあるすべての .jpg ファイルの人間が読めるサイズを一覧表示し累計を表示

du -ch */*.jpg
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?