Online Linux Terminal Logo
OnlineLinuxTerminal
Disque et stockageCLI Manual

$du

Estimate file and directory space usage.

Syntaxe de la commandePOSIX Standard
du [OPTIONS] [FILE...]
Communauté Linux2.4k En ligne

Échangez avec des utilisateurs Linux, apprenez des commandes et téléchargez des PDF.

Essayer en direct dans le bac à sable interactif

Simulation côté client sans installation avec retour instantané.

Ouvrir dans le terminal plein écran ↗
bash — terminal

Aperçu et fonctionnement

`du` (Disk Usage) measures the space occupied by individual files and folders on disk. Unlike `df` which inspects entire partitions, `du` recursively scans directories to identify which folders or log files are consuming disk space.

Options et drapeaux courants

Flag / OptionDescription
-s, --summarizeDisplay only a total sum for each specified directory argument.
-h, --human-readablePrint sizes in human readable format (e.g., 24K, 500M, 4G).
-d, --max-depth=NPrint total for a directory only if it is N or fewer levels below.

Exemples pratiques du monde réel

#1Check folder size summary
du -sh /var/log

Outputs the total human-readable size of the /var/log directory.