Determining disk usage with du

Another piece of information that you can access is how much disk space within the UNIX system is in use. You can do so using du, as shown in Code Listing 7.5.

To determine disk usage with du:

  • du
    At the shell prompt, enter du. As Code Listing 7.5 shows, you'll get information about disk usage in the current directory as well as in all subdirectories. The numbers are usually measured in 1K blocks (as with df). You can make sure by using du -k.

Tip

If you're on a system that enforces disk-space quotas (like most ISPs do), you can find out what your quota is and how close you are to reaching it. Just type quota -v at the shell prompt.

Tip

You can use du with a path name to check the disk usage in just a single directory ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.