du -csh /
The above will take huge amount of time to calculate,is there a way to see the less accurate result with less overhead?
UPDATE
What I want to know is the total size under a specific directory.
The above will take huge amount of time to calculate,is there a way to see the less accurate result with less overhead? UPDATE What I want to know is the total size under a specific directory.
| ||||
|
feedback
|
|
As far as a more optimized version
Out of all these, the quota and dedicated partition options are probably the easiest and most efficient. | ||||
|
feedback
|
Gives you the sizes in human KB/MB/GB format from your current working directory. | |||||
feedback
|
|
With the standard tools you have to get the size of every file in the directory each time you want to know the total size. A possibly more efficient way to do it would be to have a "directory size monitor", which keeps track of the current size of the directory. There is no such thing (that I know of), but you could implement one with | |||
|
feedback
|
|
The problem is that 'du' has to enumerate every object in the sub-tree. This is a metadata intensive operation, and takes a while for most Linux filesystems. Some filesystems, NTFS and Novell's NSS come to mind, have the ability to keep track of directory sizes like this in the metadata which makes this operation vastly faster. Generally, if your file-system supports directory quotas of some kind, it has to keep track of this data internally for enforcement, every size-change is replicated up the directory-tree to the quota-point (NTFS) or every directory (NSS) when it happens, so getting a directory-tree size is very fast. Unfortunately, there isn't a way to make du run faster, just work-arounds.
| |||||
|
feedback
|
|
No. Could you periodically do a du piped to a text file, in a cron job set to run overnight, so you've got not quite current data immediately available? Note that measuring the disk space used by a folder containing a large no of files under Windows similarly takes some time. | |||
|
feedback
|
|
You might find | |||
|
feedback
|
|
df -h will do the trick | |||
|
feedback
|
|
df -kh / this will show you the amout of disk space used and available. | |||
|
feedback
|
|
Perhaps
extra text since a short, concise answer isn't enough for serverfault to think I am human. | |||||||||||||
feedback
|
|
To find the space under just that directory, list it instead of
| |||
|
feedback
|
|
Also, consider the -x option on du -- "one file system" if your doing
You'll only see the disk usage summary on your root partition, and it won't try to add up /proc, /sys, /dev, and so on... | |||
|
feedback
|
|
You should use dnotify to calculate the disk usage if the filesystem is not changed often. | |||
|
feedback
|