du command prints the size of each file and directory that is inside the current directory. Its most basic usage is as easy as it gets:
That outputs a long list of directories and how much space their files take up. You can modify that with the
-a parameter, which instructs
du to print the size of individual files as well as directories. Another useful parameter is
-h, which makes
du use human-readable sizes like 18M (18MB) rather than 17532 (the same number in bytes, unrounded). The final useful basic option is
-c, which prints the total size of files.
du we can get a printout of the size of each file in our
/home directory, in human-readable format, and with a summary at the end, ...