Determining the size of a folder in Unix is a fundamental task for managing disk space and organizing files. To check the size of a folder, you can use the ‘du’ command, which stands for ‘disk usage’. This command provides detailed information about the disk space occupied by files and directories.
The ‘du’ command has several options that allow you to customize the output. The most commonly used option is ‘-h’, which displays the size in human-readable format, such as megabytes (MB) or gigabytes (GB). For example, to check the size of a folder named ‘my_folder’, you can run the following command: