💾 Archived View for auragem.letz.dev › unixdocs › diskspace.gmi captured on 2024-08-31 at 13:34:55. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-03-21)

-=-=-=-=-=-=-

Check Disk Space on Unix, Linux, and macOS

Command Line

To show the disk usage of all mounted volumes:

dh -h

You can specify the mountpoint as an additional argument to the command:

dh -h /

To check the storage usage of a directory, use the following command:

du -sh ~

The -s flag tells it to report statistics for the single directory, and the -h flag makes the output human readable. To see usage of all subdirectories under the specified directory, remove the -s flag:

du -h ~

The --max-depth flag will limit the traversal into subdirectories to that maximum depth:

du -h --max-depth=1 /home/user

Note that you must use root privileges (or sudo) to run the "du" command on the root directory.

GUI

You can use the (Gnome) Disk Usage Analyzer on Linux to give a full readout of your hard disk space and which folders use up that space. Install it on Ubuntu like so:

sudo apt install baobab

Ubuntu also has a built-in Disks utility.