I want to calculate the size of my
home directory, which has a lot of sub directories.
It takes about 40 seconds to run
Is there a quicker way?
$ time du -sh 5.0G . real 0m39.676s user 0m0.058s sys 0m3.151s
A rather round about method would be to put your home directory on a separate partition that gets mounted at boot, making sure it is large enough for all your future needs.
After you've done that then the fastest way to tell how much space you are using is the
… or, thirdly, one can use disc quotas.
A variant on Mokubai's roundabout answer is to have all home directories on a dedicated volume for home directories, to enable disc quotas on that volume (and build the quota database if quotas are being added to a volume with data already on it), and to use the
This really does have an advantage over
And, of course, all the security and maintainability advantages of having a separate volume for all home directories also apply.