Fun With The du Command

Looking at the space taken up by my copy of the Blender source code: ldo(a)theon:projects> du -ks blender 1444272 blender Most of that is in the commit history: ldo(a)theon:projects> du -ks blender/.git 1139640 blender/.git So how much isn’t? ldo(a)theon:projects> du -ks blender/.git blender 1139640 blender/.git 304632 blender Do you see what happened there? If you specify a directory, and then its containing directory on the same command, du will subtract the usage of the former from the latter. This gives you an easy way of determining the space taken up by a directory, not including particular subdirectories. This can be broken down even more: ldo(a)theon:projects> du -ks blender/.git blender/extern blender/intern blender/source blender 1139640 blender/.git 40536 blender/extern 15712 blender/intern 105188 blender/source 143196 blender Here, “extern” is various open-source libraries from other sources, that have been copied into the Blender source tree, while “intern” is code that originated from Blender itself, that has been organized into its own libraries. And as you can see, there is still a whole bunch left in other subdirectories. Does this work recursively? ldo(a)theon:projects> du -ks blender/.git blender/intern/cycles blender/intern blender 1139640 blender/.git 8880 blender/intern/cycles 6832 blender/intern 288920 blender Yes it does. Here we can see that the Cycles renderer makes up a bit over half the contents of “intern”.
participants (1)
-
Lawrence D'Oliveiro