• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How To Find Large Files And Directories In Linux Command Line

How To Find Large Files And Directories In Linux Command Line

By Sourabh / March 20, 2026 Category: How To, Ubuntu

Linux users can run the following command to find the top 10 largest files and directories in the current file system.


1. Find Top 10 Largest Files and Directories (Current Directory)

To analyze disk usage within your current working directory, use:

du -ahx . | sort -rh | head -10

In the above command:

  • du -ahx .
    • du: Estimates disk usage
    • -a: Includes both files and directories
    • -h: Human-readable format (KB, MB, GB)
    • -x: Stays within the same filesystem
  • sort -rh
    • Sorts output by size in descending order
  • head -10
    • Displays the top 10 largest entries

This command is very useful in quickly identifing space-heavy files in a project or directory.


2. Find Top 10 Largest Files on the Entire System

To scan the whole system for the largest files:

sudo find / -type f -exec du -h {} + 2>/dev/null | sort -rh | head -n 10

In the above command:

  • sudo: Required to avoid permission errors
  • find / -type f: Searches all regular files in the root filesystem
  • -exec du -h {} +: Calculates size of each file
  • 2>/dev/null: Suppresses permission denied errors
  • sort -rh | head -n 10: Shows top 10 largest files

3. Find Files Larger Than a Specific Size

To locate files exceeding a defined size (e.g., 100MB):

find / -type f -size +100M -exec ls -lh {} +

The command option “-size +100M” filters files larger than 100MB. Don’t forget to use k for KB, M for MB, G for GB.


4. Find Largest Directories in Linux

To find the biggest directories (e.g., in /home):

du -a /home | sort -n -r | head -n 10

The du command lists disk usage of all directories and files, sorts them from largest to smallest and displays top 10 results.

You must use du -h for human-readable output.


5. Find Largest Files Only

If you’re interested only in files (not directories):

find -type f -exec du -Sh {} + | sort -rh | head -n 10

In the above command:

  • -type f: Filters only files
  • du -Sh: Displays size in human-readable format, summarizing each file
  • Sorted to show largest files first

The find Command

The find command is a powerful utility used to search for files and directories based on multiple criteria.

find command syntax:

find [path] [options] [expression]

Command options:

  • [path]: Starting point (e.g., ., /, ~)
  • [options]: Controls behavior (e.g., -maxdepth)
  • [expression]: Search filters (e.g., -name, -type, -size)

Usage Example:

find . -name "*.log"

Finds all .log files in the current directory.

The du Command

The du (disk usage) command estimates file and directory space usage.

du command syntax:

du [OPTIONS]... [FILE]...

Mots-used Command Options:

  • -h → Human-readable output
  • -s → Summary (total size only)
  • -a → Include all files
  • -c → Show grand total
  • -d N → Limit directory depth

Usage Examples:

  • Check current directory usage:du -h
  • Summarize a folder:du -sh /var/log
  • Limit depth:du -h -d 1

I hope you find this post useful.

Primary Sidebar

Latest Posts

Use Locate Command To Find File In Linux Terminal By Name

How To Change Terminal Color In Ubuntu Command Line

How To Run Fsck Manually In Linux To Fix Unexpected Inconsistency

How To Fix Broken Packages On Ubuntu From Terminal

Re Execute The Previous Command In Linux Ubuntu Command Line

How Much RAM Is Needed For Ubuntu PC

How To Use Clear Command History In Linux Terminal

Linux Command To Check RAM Size In Ubuntu Terminal In GB

How To Install Proprietary Drivers In Linux Ubuntu Using Terminal

How To Shutdown Linux With A 15 Minute Delay And Message

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap