There are several commands you can use in Unix to view disk usage information, including:
df
: Thedf
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.).
du
: Thedu
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.
ncdu
: Thencdu
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.