Tutorials  /  Linux Basics

Check Disk Space on Linux: df, du & find Commands

Ccentron Redaktion · September 2025 ·5 min read ·Linux Basics, Tutorial

Handling disk space is an essential duty for Linux administrators and users. When a disk becomes full, it can slow down performance, break services, and even block user access to important directories. Whether managing a personal computer, a dedicated server, or a cloud instance, knowing how to monitor disk usage ensures system reliability and prevents unexpected downtime.

This guide demonstrates how to review disk space and usage on Linux with built-in terminal tools. You will see how to detect large files, evaluate mounted file systems, and fix disk-related problems effectively.

Commands to Check Disk Space and Usage

Linux provides several command-line utilities to track and manage storage usage. These commands reveal how much space is consumed, how much remains, and which files or directories are taking the most capacity. Using them regularly helps avoid system lags, service interruptions, and data issues caused by full partitions.

Common Disk Management Commands

Command Description Typical Use Case
df Shows available and used disk space on mounted file systems. View an overview of all partitions.
du Summarizes space consumption by directories and files. Identify the largest directories.
find Searches files and directories based on size, type, name, or modification time. Locate large or old files using flags like -size, -mtime, -type.
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

How to Check Disk Space

The df command gives a quick snapshot of storage usage across all mounted partitions. Use it to identify low-space partitions before system performance is affected.

df Command Syntax

The general syntax is:

Code
df [OPTION]... [FILE]...

[OPTION]: Flags passed to the command.

[FILE]: A file or directory. If not specified, all mounted file systems are displayed.

Common df Options

Option Description
-h, --human-readable Display sizes in KB, MB, GB.
-B, --block-size=SIZE Scale output to specified size (e.g., MB).
-i, --inodes Show inode statistics.
-l, --local Show only local file systems.
--sync Run sync before output.
--total Provide a grand total.
-t, --type=TYPE Limit listing to certain file system types.
--help, --version Display help or version info.

df Command Examples

Show all mounted file systems in human-readable format:

Code
df -h

Example output:

Code
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda2       150G   12G  132G   9% /
/dev/vda1       260M  7.1M  253M   3% /boot/efi
tmpfs           768M  4.0K  768M   1% /run/user/1000
/dev/vdb1        40G  1.1G   37G   3% /mnt
/dev/vdc1        40G  375M   40G   1% /home

Here you can see columns for Filesystem, Size, Used, Available, Usage %, and Mount point.

Check usage of a single mount point:

Code
df -h /mnt

Filter by file system type (e.g., ext4):

Code
df -h -t ext4

Exclude a specific type (e.g., tmpfs):

Code
df -h -x tmpfs

Show output with file system types included:

Code
df -hT

Check inode usage:

Code
df -i

How to Check Disk Usage

The du command calculates and displays disk usage of files and directories. It's valuable for identifying large items that may need cleanup.

du Command Syntax

Code
du [OPTION]... [FILE]...

du Command Options

Option Description
-h, --human-readable Output in KB, MB, GB.
-s, --summarize Show total size only.
-a, --all Include file sizes as well.
-c, --total Produce a grand total.
-d N, --max-depth=N Limit directory depth.
--exclude Ignore specified files.

du Command Examples

Check usage of a directory:

Console
sudo du -sh /path/to/directory

Include hidden files:

Console
sudo du -ah /path/to/directory

Exclude specific files:

Console
sudo du -ah --exclude='*.log' /path/to/directory

Limit depth to top-level subdirectories:

Console
sudo du -h --max-depth=1 /var

Sort by size:

Console
sudo du -h --max-depth=1 /var | sort -rh

Find files larger than 50MB:

Console
sudo find /var -type f -size +50M -exec ls -lh {} \;

Conclusion

With commands like df, du, and find, you can efficiently monitor storage, detect large files, and prevent downtime due to full disks. Applying these tools keeps your Linux systems optimized and reliable.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren