Frequent Question: How Do I Analyze Disk Usage in Linux?
Contents How Do I Check Disk Usage per Directory in Linux? the Df and Du Command Line Utilities Are the Two Best Tools We Have to Measure Disk Consumption on...
Contents
How do I check disk usage per directory in Linux?
The df and du command line utilities are the two best tools we have to measure disk consumption on Linux. For checking disk usage by folder, the du command is particularly useful. When running du without any extra options, keep in mind that it will check the total disk usage of each subdirectory, individually.
Must Read
How do I find out what’s taking up space on Linux?
To find out where disk space is being used:
- Get to the root of your machine by running cd /
- Run sudo du -h –max-depth=1.
- Note which directories are using a lot of disk space.
- cd into one of the big directories.
- Run ls -l to see which files are using a lot of space. Delete any you don’t need.
- Repeat steps 2 to 5.