Your solution counts files multiple times if there are multiple links to a file. OTOH, you are not counting the size of directories themselves. (Even an empty directory has typically a size of 4096 bytes).
du takes care of both things.
In reply to Re^2: Unix size again
by JavaFan
in thread Unix size
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |