How to find large files in Linux (and which directories hide them)
Use two built-in commands—du piped to sort, then find with a size filter—to locate the directories and files consuming disk space before you delete anything.

Use two built-in commands—du piped to sort, then find with a size filter—to locate the directories and files consuming disk space before you delete anything.

List files above a size threshold with find -type f -size +100M to name the specific large files to inspect.
When a Linux machine fills its disk, guessing and deleting files is risky. A brief, methodical approach using tools that ship with Linux finds the directories that weigh the filesystem and the individual files inside them.
du (disk usage) measures directory size. Run it as root so it can read every directory instead of producing permission errors: sudo du -h -d 3 /
Find the large files inside the heavy directory
Once you identify the heavy directory—say /opt/data—use find to list files above your chosen threshold. For files over 100 MB: find /opt/data -type f -size +100M
Don't delete files before you understand ownership and purpose. Package caches, system journals, databases, and backups belong to applications or system services and often have safe cleanup commands. Examples mentioned in the source:
If du and find can't account for the disk usage reported by df, a process may be holding a deleted file open. The inode remains allocated until the process releases it. Use sudo lsof +L1 to list deleted-but-still-open files and restart the owning service to free the space.
If you can install software, ncdu provides an interactive, size-sorted view you navigate with arrow keys: sudo ncdu /. That's convenient on machines you control. On locked-down servers where installing packages isn't possible, the du | sort approach works everywhere because it relies only on standard tools.
Two simple commands give a reliable map of disk usage: sudo du -h -d 3 / | sort -h to rank directories by size, then find -type f -size +100M to name the file-level culprits. Use safe cleanup commands or identify the owner before deleting files, and check for deleted-but-open files with sudo lsof +L1 when df shows space used that du and find cannot locate.

Use a methodical approach to see what's using the most space on your PC and easily clean it up.

How to use htop to find the process eating your CPU, RAM, or disk: install it, read the sort, and kill with SIGTERM before SIGKILL. Real steps.

2>/dev/null sends a command's error stream into the Linux black hole. What the 2, the >, and /dev/null each do, shown on a real find command.

I teach new Linux users these four short, easy to remember commands early on. Learn what they are and how to use them.
Debian and Xfce – solid, sensible choices – with a pretty skin

From data centers to smartphones Linux quietly powers critical infrastructure and devices used by billions worldwide.
Loading more related stories...
Open the app view to save this story, compare related coverage, and continue from the same source.