Determining Disk Usage

 < Day Day Up > 

System administrators like to know the amount of disk space consumed on their system by users, applications, groups, and so on. It's a good idea to know the disk hogs on a system. The du command helps with this determination. With du, you specify a file for which you want to view disk usage. You can also use the -s option to produce a summary as shown in the following example for the entries in the /usr directory:

 # du -s * 200680  OpenOffice.org1.0 125948  X11R6 160680  bin 4       dict 4       etc 24      games 61700   include 3556    kerberos 950512  lib 49412   libexec 92      local 16      lost+found 15956   sbin 766292  share 432524  src 0       tmp # 

To see the entire disk usage of this directory in summary form, issue the following command:

 # du -s 2767404. # 

This output shows the total disk usage in this directory as roughly 2.74 GB. This can be confirmed by running the df command also. Running du on a regular basis shows the amount of space various directories are consuming and can be used to identify areas of your system in which disk space has increased dramatically over a short period of time.

     < Day Day Up > 


    Linux on HP Integrity Servers. A System Administrator's Guide
    Linux on HP Integrity Servers: A System Administrators Guide
    ISBN: 0131400002
    EAN: 2147483647
    Year: 2004
    Pages: 100

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net