24.9 How Much Disk Space?Two tools, df and du , report how much disk space is free and how much is used by any given directory. For each filesystem, df tells you the capacity, how much space is in use, and how much is free. By default, it lists both local and remote (i.e., NFS ( 1.33 ) ) filesystems. Under BSD UNIX, the output from df looks like this:
% This report shows information about five local filesystems and two remote filesystems (from the system toy ). The /research and /field filesystems are nearly filled (98 and 97 percent, respectively), while the other filesystems still have a lot of room left. You might want to take some action to free up some storage on these two filesystems. Note that a BSD filesystem that is 100 percent full really has 10 percent free space–but only the superuser ( 1.24 ) can use this last 10& percent, and that usually isn't a good idea. df can be invoked in several other ways:
If you are using the older System V filesystem, the report from df will look different. The information it presents, however, is substantially the same. Here is a typical report, taken from a XENIX system:
%
It is often useful to know how much storage a specific directory requires. This can help you to determine if any users are occupying more than their share of storage. The du utility provides such a report. Here's a simple report from du :
% This command shows that the current directory and all of its subdirectories occupy about 2.5 MB (2634 KB). The biggest directories in this group are stuff and howard , which have a total of 888 KB and 868 KB, respectively. The report also shows storage occupied by sub-subdirectories ( /howard/work , etc.). du & does not show individual files as separate items, unless you invoke it with the -a & option. Note that System V reports disk usage in 512-byte blocks, not KB. The -s option tells du to report the total amount of storage occupied by a directory; it suppresses individual reports for all subdirectories. For example:
% This is essentially the last line of the previous report. - from O'Reilly & Associates' System Performance Tuning , Chapter 5 |
|