How to Check Disk Space in Linux
Last Updated :
06 Nov, 2025
Knowing how to check disk space in Linux helps you monitor usage, prevent issues, and optimize resources. Here are all five commands which was used to check disk space in Linux. Here are methods:
Method 1. Using df Command
The `df` command, short for “disk-free,” is a tool for displaying available and used disk space on your Linux system. It’s very simple in both usage and reporting.
Syntax of `df` Command in Linux
df [OPTIONS]
Here are some common options you can use with the df command:
Option | Description |
|---|
-h | Human-readable output (e.g., KB, MB, GB). |
|---|
--help | Display help information. |
|---|
-T | Display the file system type. |
|---|
-a | Display information about all file systems, including those with 0 blocks. |
|---|
-i | Display inode information instead of block usage. |
|---|
-k | Display block counts in 1K-byte blocks. |
|---|
-m | Display block counts in megabytes. |
|---|
-B <size> | Specify the block size to use. |
|---|
--total | Display a total summary line. |
|---|
--version | Display version information. |
|---|
--sync | Invoke sync before getting usage info. |
|---|
This option presents disk space information in a human-readable format. It displays sizes in gigabytes (GB), megabytes (MB), or kilobytes (KB) for easy comprehension. Here's an example:
df -h
df -h- Filesystem: Name of the file system or disk partition.
- Size: Total size of the file system or partition.
- Used: Amount of space already consumed.
- Avail: Available or free space on the file system.
- Use%: Percentage of used space relative to the total size.
- Mounted on: Directory where the file system is mounted in the system.
Check the disk space for Specific Drive
If you want to check the disk space from Specific Drive use the below command which show the drive at /dev/sda1.
df -H /dev/nvme0n1
Method 2. Using du Command
While df checks drives, du checks folders and files. The `du` command is used to analyze the disk usage of files, folders, and directories on your Linux system.
Syntax:
du <options> <location of directory or file>
The -h option shows disk usage in a human-readable format for all directories and subdirectories. Here's an example:
du -h /home/administrator/Documents/
Here you can replace "/home/administrator/Documents/" with your desider directory.

Check a Folder’s Total Size
If you want to check the folder size in linux so use the below command:
du -sh /home/yourname/Documents
-s: Summarizes the total (no endless file lists).-h: Human-readable sizes (e.g., "2.5G").
Method 3. Using pydf Command
pydf is a Linux command written in Python that display the disk usage space in a colorful and readable format. It is an easy-to-use replacement for the df command since it makes disk management more convenient with the use of colors. Utilize the following command below to monitor your disk space effectively:
pydf
Example:
pydfMethod 4. Using fdisk -l Command
The `fdisk -l` command shows disk size and partitioning information, helping you understand your storage configuration.
sudo fdisk -l
fdisk -lMethod 5. Using lsblk Command
The lsblk command in Linux lists information about block devices (like hard drives, SSDs, and their partitions) in a tree-like structure.
lsblk
Example:
lsblkThe lsblk command showing the details like device names, major/minor numbers, sizes, types, read-only attributes, and mount points. While it doesn’t show precise disk usage, it excels in visualizing the relationship between devices and their partitions.
To calculate unallocated space, add up the sizes of all partitions and subtract this sum from the total size of the drive. This gives a clear idea of unused space on the device.
Also Check:
Regularly check disk space in Linux is crucial for maintaining your system's performance and avoiding unexpected storage issues. With the methods outlined in this article, including commands like df, du, pydf, fdisk -l, and lsblk, you can effectively monitor and manage your disk usage. Each tool offers unique insights, from a high-level overview to detailed partition layouts.
Explore
Linux/Unix Tutorial
5 min read
Getting Started with Linux
Installation with Linux
Linux Commands
Linux File System
Linux Kernel
Linux Networking Tools
Linux Process
Linux Firewall
Shell Scripting & Bash Scripting