How to Check Disk Space on Linux

To check the remaining space in the Linux file system, you can use the following command:

  1. Using the df command: The df command displays the disk usage of file systems, including used space, available space, and total space. To view the disk usage of all file systems, you can run the following command:
df -h

The option ‘h’ can display disk usage in a user-friendly format, such as GB or MB.

  1. To utilize the “du” command, you can display the disk usage of a specified directory or file. To check the disk usage of a specific directory, run the following command:
du -sh /path/to/directory

The -s option displays only the total size of the directory, while the -h option shows the size in a more readable format.

With the above command, you can check the remaining space of the Linux file system.

bannerAds