System MonitoringLesson 27Free preview
Bash Directory Usage (du)
This lesson is part of Bash · All levels
Summary
The du command calculates the disk space usage per file and per directory. With -s you get a total of one folder, whereas -h makes the numbers easy to read. It's very helpful to find which folders are the largest and need cleaning.
Key points
- Du displays file size and total of each directory
- s just showing the summary
- h converts the unit to K, M, G
- Du -sh * sorted to find the largest folder
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.