To check the disk space usage on a Linux system, you can use the df
command.
Here's an example of how to use df
to display the amount of free and used space on all the mounted filesystems:
$ df -h
The -h
option tells df
to display the sizes in "human-readable" format, with sizes expressed in bytes, kilobytes, megabytes, and so on.
You can also use df
to display the disk space usage for a specific filesystem or directory. For example:
$ df -h /
This will display the disk space usage for the root filesystem (/
).
Another useful command for checking disk space usage is du
, which displays the amount of space used by a specific directory and its subdirectories. For example:
$ du -sh /home
This will display the total space used by the /home
directory and its subdirectories.
Note: The specific options and syntax for these commands may vary depending on your Linux distribution and version. Consult the
df
anddu
man pages or documentation for your system for more information.