Determining the size of a folder in Linux is a common task for system administrators and users alike. It helps in managing disk space, identifying large directories, and optimizing storage usage. There are several methods to check the size of a folder in Linux, each with its own advantages and use cases.
One of the most straightforward methods is using the ‘du’ command. ‘du’ stands for “disk usage” and provides detailed information about the space occupied by files and directories. To check the size of a folder using ‘du’, navigate to the directory’s parent directory and execute the following command: