I needed to find out the size of a directory while connected to my Ubuntu server. When I used the properties menu in Windows explorer however, that data was not populated so I needed an alternative – the terminal. It turns out that using the terminal to find the directory size is incredibly easy.

The basic syntax for finding the directory size in Linux is goes like this: du [options] /path/to/directory. Running the command without any options will show you the size of each sub-directory and as well as the total as the last line in the output. But there are a bunch of helpful option configurations. You can always see du --help if you want more.