Linux Example | Get the Size of a Folder

In this linux example, we will introduce how to get the size of a folder. We will use du linux command to get.

How to use du command to get a folder size

Look at example code below:

sudo du -sh /var

This example will output the size of var folder.

Run this command, you may get a size: 

85G	/var

From this example code we can find: To get the size of a folder in linux, we can do as follows:

sudo du -sh folder_path