How to Check Directory Size in Ubuntu
To check the size of a directory in Ubuntu, you can use the du command. This command stands for "disk usage" and it shows the amount of disk space used by the specified files or directories.
Options:
-h , --human-readable
-s, --summarize
-a, --all
-c, --total
--max-depth
To use the du command, open a terminal window and navigate to the directory whose size you want to check. Then, type du followed by the name of the directory, like this:
du /path/to/directory
This will display the size of the directory in kilobytes. If you want to see the size of all the files and directories inside the specified directory, you can use the -a
option like this:
du -a /path/to/directory
This will display the size of each file and directory inside the specified directory, along with the total size at the end.
You can also use the -h option to display the size in a more readable format, such as megabytes or gigabytes, like this:
du -ah /path/to/directory
This will display the size of each file and directory in the specified directory in a human-readable format.
Overall, the du command is a useful tool for checking the size of directories in Ubuntu.