Select Page

How to get the size of a directory using the command line in Linux

  1. Open a new Terminal Window and type the following command:
    du -shc folderPath

    Explanation of the du command:

    du - estimate file space usage
    
    -s, --summarize, display only a total for each argument
    -h, --human-readable, print sizes in human readable format (e.g., 1K 234M 2G)
    -c, --total, produce a grand total
    

     

  2. Replace folderPath with the folder to check the size on.

Last Updated On April 07, 2018

Leave a reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.