Managing disk space is essential for keeping your Linux system running smoothly. Whether you prefer the command line or graphical tools, here’s a straightforward guide to checking your free and used storage.
1. Quick Terminal Commands
Check Total Disk Usage (df
)
The simplest way to see disk space across all partitions:
df -h
-
-h
→ Shows sizes in GB/MB (human-readable). -
Key columns:
-
Avail
→ Free space. -
Use%
→ Percentage used.
-
Example Output:
Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p3 200G 50G 150G 25% /
Check Folder Sizes (du
)
To see how much space a specific folder (like /home
) is using:
du -sh ~/
-
-s
→ Summary (total size). -
-h
→ Human-readable format.
Interactive Disk Usage Analyzer (ncdu
)
For a more detailed breakdown, install ncdu
:
sudo pacman -S ncdu
ncdu /
- Navigate with arrow keys.
-
Sort by size (press
n
for name,s
for size). -
Delete files directly (press
d
).
2. Graphical Tools (For Desktop Users)
GNOME Disks (Default in GNOME)
- Open "Disks" from the app menu.
- Select your disk → View partition usage in the graph.
KDE Partition Manager (For KDE Plasma)
- Install it:
sudo pacman -S partitionmanager
- Open Partition Manager → Check disk space visually.
File Manager (Thunar/Dolphin/Nautilus)
- Open your file manager (e.g., Thunar in Xfce).
- Right-click a drive → Properties → See free space.
3. Advanced: Finding Large Files
To locate large files (>100MB) in your home directory:
find ~/ -type f -size +100M -exec ls -lh {} \;
-
-type f
→ Files only (excludes folders). -
-size +100M
→ Filters files larger than 100MB.
Summary: Which Method Should You Use?
Use Case | Recommended Tool | Command |
---|---|---|
Quick overview of all disks | df -h |
df -h |
Check a folder’s size | du |
du -sh ~/ |
Interactive disk analysis | ncdu |
ncdu / |
GUI (GNOME) | Disks app | Open from Applications |
GUI (KDE) | Partition Manager | sudo pacman -S partitionmanager |
Find large files | find |
find ~/ -size +100M |
thank you :>|
Top comments (0)