How to Check Disk Space on Ubuntu?
Managing your storage is a fundamental part of maintaining a healthy Linux environment. This guide provides a quick overview of how to check the available disk space on an Ubuntu system using both the command-line interface (CLI) and the graphical user interface (GUI). Whether you need a fast, detailed breakdown in the terminal or a visual representation of your storage, the following methods will show you exactly how much space you have left and where your files are hidden.
Checking Disk Space via the Command Line
The terminal is the fastest way to get accurate storage data. Ubuntu
includes two powerful, built-in commands for this task: df
and du.
- The
dfCommand (Disk Free): This command displays the amount of available and used disk space on your filesystems. To make it readable, always use the-hflag for “human-readable” format (showing sizes in GB and MB).
df -hThis outputs a list of all mounted filesystems, their total size,
used space, available space, and usage percentage. * The
du Command (Disk Usage): While df
shows overall system space, du helps you track down which
specific directories or files are consuming the most storage. To check
the size of the current directory and its subdirectories in a
human-readable format, run:
du -sh *The -s flag gives a summary (total size) for each item,
preventing a massive wall of text.
Checking Disk Space via the GUI
If you prefer a visual approach, Ubuntu’s desktop environment offers intuitive built-in tools to inspect your storage without typing commands.
- The Disk Usage Analyzer (Baobab): This is the most effective graphical tool for finding space hogs. Open your Activities overview, search for “Disk Usage Analyzer,” and launch it. It scans your drives and presents a color-coded ring chart or treemap showing exactly which folders take up the most room.
- The Disks Utility: For a broader overview of hardware partitions and drive health, search for “Disks” in the application menu. This utility displays your physical hard drives, their partition layouts, and how much space is allocated to each section.