Yep du will print the size of directories and their files if you use the right command line arguements. And then you use the > to pipe it into a file of your choosing.
For learning around the command line there are a couple guides that are usefull, one is the introduction to linux: hands on linux guide, and the other is the bash scripting guide for beginners. A bit dry and targetted more for the administrator types, but usefull, I beleive. They are from guide section from tldp.org.
Man files are usefull..