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.

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

More Similar Posts

No results found.