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

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

Image Credits: Photo by Isis França on Unsplash.

Last Updated On April 07, 2018

Related Articles

No results found

Leave a Reply

Notify of
Copy link