How to Use Du to Estimate File Space Usage

|

To get an estimate of the space a certain file is using on your computer, you can use the "du" command. This is useful because it provides a report of the amount of disk space used, allowing you to estimate the amount of space remaining.

Use Du Options to Estimate File Space Usage

Step1 Know that du typically provides a report of disk space usage only on a single directory that you happen to be using at the time. Use the "-a" command to show usage for all files, not just your current directory. Alternatively, use "--all."

Step2 Change the default block size by using the "-b" function. This may also be written in "--bytes."

Step3 Use the "-c" function to print totals. This is useful when you want to know how much disk space is being used by a group of files or an entire directory. It can also be written as "--total."

Step4 Use the "-h" function to make it easier to read. Instead of viewing disk space usage as some power of 1,024, it converts the number into more manageable kilobytes, megabytes, gigabytes and so on.

Step5 Use the "-H" function if you'd rather work with a base of 1,000 instead of 1,024.

Step6 Use "-s" to estimate file space usage for each individual argument.

Step7 Capitalize the s to read "-S" to estimate the file usage for each separate directory. Note that file space usage of subdirectories will not be factored in.

Step8 Ignore directories on irrelevant file systems by using the "-x" function. This is the "--one-file-system" function.

Step9 Exclude subdirectories you're not interested in. The exclude function would look like "du--exclude=XXX" with XXX being whatever it is you want to exclude. For example, you could exclude an estimate of file space usage for all files ending with a certain number or letter. This can be useful in systems where similar files are differentiated by a number.

0 comment:

Post a Comment

 

©2009 computer technology World | Template Blue by TNB