10 Useful du (Disk Usage) Commands to Find Disk Usage of Files and Directories

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. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  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.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

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...

23 Responses

  1. Cedric says:

    I would like to mention also this combination, in order to find the biggest sub-folders in current location:

    du -h –max-depth=1


  2. rlinux57 says:

    Is is possible to collect historical data analysis of disk space usage per user ?

    • Ravi Saive says:


      No you can’t use du (disk usage) command to get the disk space usage per user, yes but you can do use some command-line tricks with the help of find and awk command to find out the disk space usage for all users on the system including root user, here is the command.

      # find . -printf "%u  %s\n" | awk '{user[$1]+=$2}; END{ for( i in user) print i " " user[i]}'
      • rlinux57 says:

        But i need want to get the historical disk space usage, not current usage.

        • soft says:

          You could start a cron to run this command at different times to log the historical data
          find / -printf “%u %s\n” | awk ‘{user[$1]+=$2}; END{ for( i in user) print i ” ” user[i]}’

          • soft says:

            find / -printf “%u %s\n” | awk ‘{user[$1]+=$2}; END{ for( i in user) print i ” ” user[i]}’ > /yourlogdir/log_`date +_%m_%d_%Y_%H%M%S`

  3. rosh says:

    Another nice option is to sort by size: du -h * | sort -h

  4. Ashish Karpe says:

    how to find du of / ie when I ran du -sh / it gives du: cannot access `./proc/14498/task/14518/fdinfo/35147′: No such file or directory
    du: cannot access `./proc/14498/task/14518/fdinfo/35156′: No such file or directory

  5. Yasminhth says:

    Thanks for tips. Well explain ans example

  6. abhi says:

    very nice work. It helped me.

Got something to say? Join the discussion.

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

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?