Check how much free space is available in Linux

To see how much free space is available in Linux, you can use the df (disk free) command.

Here's how:

  1. Open a terminal window.
  2. Type the following command and press Enter:

df -h

The -h option will display the sizes in a human-readable format (e.g. "1.2G" instead of "1234567").

You should see a list of all mounted filesystems along with their disk usage information. The "Available" column will show you how much free space is available on each filesystem.

Note: If you want to check the free space of a specific directory or partition, you can use the du (disk usage) command instead. For example:

du -sh /path/to/directory

This will show you the size of the specified directory in a human-readable format.

Subscribe to Software Engineer Tips And Tricks

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe