How can I check the size of a folder in Linux?
You can use the following command in a Linux system to view the size of a directory:
- The “du” command is used to estimate the disk space usage of a file or directory.
- du -h
: Display the size of the folder in a human-readable format. - Show only the total size of the folder by using du -sh
. - You can use the ncdu command to interactively view the sizes of folders. If it is not installed, you can use the sudo apt install ncdu command to install it.
- ncdu
: start interactive interface for viewing folder sizes.
With these commands, you can easily check the size of the folders occupying space.