UNIX Disk Usage Command Examples

There are several commands you can use in Unix to view disk usage information, including:

  1. df: The df command displays information about disk space usage on your file system. By default, df shows disk usage information for all mounted file systems.

Here’s an example of how to use df:

df -h

The -h option makes the output more human-readable, by displaying the sizes in “human-readable” format (e.g., in MB, GB, etc.).

  1. du: The du command displays the size of a directory and its subdirectories. By default, du shows the size in kilobytes.

Here’s an example of how to use du:

du -h /path/to/directory

The -h option makes the output more human-readable, by displaying the sizes in “human-readable” format (e.g., in MB, GB, etc.). Replace /path/to/directory with the path to the directory you want to check.

  1. ncdu: The ncdu command is a disk usage analyzer that provides an ncurses-based interface for viewing disk usage information.

Here’s an example of how to use ncdu:

ncdu /path/to/directory

Replace /path/to/directory with the path to the directory you want to check.

(https://www.algerie360.com/)

Leave a Comment