To check the available disk space in Linux
To check the available disk space in Linux in a readable format, you can use the df
command with the -h
option, which will display the sizes in a human-readable format (e.g., megabytes or gigabytes). Here’s how to use it:
Open your terminal and type the following command:
df -h
This command will display a list of all mounted filesystems along with their respective disk usage and available space in a human-readable format.
Here’s an example of what the output might look like:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 20G 7.5G 11G 41% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sdb1 50G 20G 28G 42% /data
In this example, you can see the filesystem, its total size (Size
), the used space (Used
), the available space (Avail
), the percentage of space used (Use%
), and the mount point (Mounted on
). The -h
flag makes the sizes more human-friendly by using units like gigabytes (G) and megabytes (M).