Dans Dev Diary 2.0 Help

Find Available Disk Space

Identify Which Folders Use the Most Space

When getting a warning that you're running out of disk space in Linux, and thus you need to identify files to remove, use the following command at the root directory, to see holistically, which folder is consuming the most space.

To identify folders by how much disk space they're using:

du -h --max-depth=1

You might need to drill down further into the folder structure to identify the files that are consuming the most space. A common place to look would be the /var/log folder. To identify the files that are consuming the most space, use the following command:

du -h --max-depth=1 /var/log
Last modified: 10 November 2023