Skip to main content

5 Linux commands to check free disk space

Linux df command

The df command stands for "disk-free," and shows available and used disk space on the Linux system.

df -h shows disk space in human-readable format

df -a shows the file system's complete disk usage even if the Available field is 0

 

df command

 

df -T shows the disk usage along with each block's filesystem type (e.g., xfs, ext2, ext3, btrfs, etc.)

df -i shows used and free inodes

 

df command

 

You can get this information in a graphical view using the Disks (gnome-disk-utility) in the GNOME desktop. Launch it to see all disks detected by your computer, and click a partition to see details about it, including space used and space remaining.

 

GNOME Disks

opensource.com

 

Linux du command

du shows the disk usage of files, folders, etc. in the default kilobyte size

du -h shows disk usage in human-readable format for all directories and subdirectories

du -a shows disk usage for all files

du -s provides total disk space used by a particular file or directory

 

du command

 

The following commands will check your total space and your utilized space.

This information can be represented visually in GNOME with the Disk Usage application, or with Filelight in the KDE Plasma desktop. In both applications, disk usage is mapped to concentric circles, with the middle being the base folder (usually your /home directory, but it's up to you) with each outer ring representing one directory level deeper. Roll your mouse over any segment for detailed information about what's taking up space.

 

Disk usage

opensource.com

 

Linux ls -al command

ls -al lists the entire contents, along with their size, of a particular directory

 

ls -al command

 

Linux stat command

stat <file/directory> displays the size and other stats of a file/directory or a filesystem.

 

stat command

 

Linux fdisk -l command

fdisk -l shows disk size along with disk partitioning information

 

fdisk - l command