How can I get the size of a large directory with lot of small sub-directories on Linux? I just want the total size the parent directory.
I tried du -s mydirectory/ but it is taking a long time to execute and I cannot keep the terminal open for long.
Is there a faster way to get the size of the directory faster or a way to run in the background so that I can close the terminal and get the results later?
dutaking 2-3 hours. Since the filesystems in questtion may have 1-2PB of occupied space this should be expected. The other parameter is the average size of the files. Traversing a directory tree consisting of 100GB files will be much faster than if the files are all 1MB.