How to Find Out Top Directories and Files (Disk Space) in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Senthil Kumar

A Linux Consultant, living in India. He loves very much to write about Linux, Open Source, Computers and Internet. Apart from that, He'd like to review Internet tools and web services.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

17 Responses

  1. Darren Warta says:

    It appears that if you use -h (human readable) with du, the sort gets confused as it doesn’t interpret the decimal unit prefix (i.e. the G, M, or K) properly, and you get the largest displayed numeric value.

    For example: 9G, 10K, 8K, 4M, 7G would sort to 10K, 9G, 8K, 7G, 4M.

    I noticed this when I got the following results:

    # du -h /data.source/ | sort -n -r | head -n 5
    1020K   /data.source/mod_tile/default/9/0/0/1/176
    1020K   /data.source/mod_tile/default/10/0/0/1/178
    1016K   /data.source/mod_tile/default/11/0/0/35/65
    996K    /data.source/mod_tile/default/9/0/0/16/170
    992K    /data.source/mod_tile/default/9/0/0/1/160
    
    # du /data.source/ | sort -n -r | head -n 5
    680595148       /data.source/
    597114072       /data.source/pgsql
    597114068       /data.source/pgsql/9.6
    597114060       /data.source/pgsql/9.6/data
    595032120       /data.source/pgsql/9.6/data/base
    
  2. Swapnil says:

    Hello Ravi,

    My questioned is to find the big file for particular date says we have thousand files of in folder with different date and need to find the biggest file of december 2016.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *