Commands to check hard disk partitions and disk space on Linux


Fdisk is the most commonly used command to check the partitions on a disk. The fdisk command can display the partitions and details like file system type. However it does not report the size of each partitions.

$ sudo fdisk -l 

Each device is reported separately with details about size, seconds, id and individual partitions.


Sfdisk is another utility with a purpose similar to fdisk, but with more features. It can display the size of each partition in MB.

$ sudo sfdisk -l 

Cfdisk works with one partition at a time. So if you need to see the details of a particular disk, then pass the device name to cfdisk.

$ sudo cfdisk /dev/sdb


Parted is yet another command line utility to list out partitions and modify them if needed.

$ sudo parted -l 


The hwinfo is a general purpose hardware information tool and can be used to print out the disk and partition list. The output however does not print details about each partition like the above commands.

$ hwinfo --block --short