6

I have several very big directories and i want to know their estimated size. I use for this purpose mostly du, but it takes for each folder about 3 minutes, so i'm asking if there is an alternative to du or stat that takes less time (it could be imprecise: ~10% would be ok)

rwx
  • 239

1 Answers1

8

The question came up before quite a few times. As far as I know here are some possible alternatives:

  • Different filesystems - If you can put each directory you're interested in on a filesystem of its own then you can just use df instead of du -> instantaneous.

  • Quotas - If you can change ownership of the directories, then you can make each owned by a different user, setup disk quotas for them and use it to keep track of how much space they're using (instantaneous also).

  • cron - Running du in a cron job (say every day or so) and using the result of the last job instead of running du directly. If you don't care about a little inaccuracy that might be an option.

  • JDiskReport reportedly can quickly analyse a drive or folder that has been recently analysed.

  • Filelight or Disk Usage Analyzer might be an option too. According to this one:

    If you've got a desktop environment on the box in question, FileLight is awesome. It's fairly quick and allows you to drill down a directory tree and then only rescan that sub-tree when you want to get an updated view. You could very well run a full scan once a day and then just leave the program open all day without ever doing an update.

lemonsqueeze
  • 1,330