Suppose you have a large tree of directories containing lots of data (such as source code of a big project or numerical output of your simulations) and you need to estimate the total size of the whole tree. In graphical user interface this can be done by examining the directory properties. But as usual things can be done faster on the command line, where the suitable command is
du (for Disk Usage).
An example (assuming that the root of your directory tree is called
du -h --max-depth=1 data
-h option tells
du to use human readable format, i.e. MB, GB etc instead of bytes. Option
--max-depth=1 means that only the first subdirectories are listed. For more info on the options run
It is convenient to create an alias for shortening the long command such as
alias disku='du -h --max-depth=1'
For the alias to be present in all future sessions, add the line to your shell initialization file (for bash shell
~/.bashrc for example).