How to Check the Disk Space on Linux

How to Check the Disk Space on Linux

How to Check the Disk Space on Linux.webp


The storage space of an operating system is much more important than you think. If your system’s storage runs out of space, it becomes unstable and slow, leading to unexpected crashes. Hence, checking the disk space helps prevent your system from all these issues. You can remove unnecessary directories or files to free up the disk space and improve the system’s overall performance.
Although checking the disk space in Windows is simple, Linux has complex ways of doing it.

The Df Command
The “df” or “disk free” command displays the system’s free and used storage space.

Use the following command: df -h

XenVn-How to Check the Disk Space on Linux - 2.webp


Your output may have more entries. The columns should be self-explanatory:
  • Filesystem – This is the name of each particular drive. This includes physical hard drives, logical (partitioned) drives, and virtual or temporary drives.
  • Size The size of the filesystem.
  • Used – Amount of space used on each filesystem.
  • Avail – The amount of unused (free) space on the filesystem.
  • Use% – Shows the percent of the disk used.
  • Mounted on – This is the directory where the file system is located. This is also sometimes called a mount point.
The list of filesystems includes your physical hard drive, as well as virtual hard drives:
  • /dev/sda2 – This is your physical hard drive. It may be listed as /sda1, /sda0, or you may even have more than one. /dev stands for device.
  • udev This is a virtual directory for the /dev directory. This is part of the Linux operating system.
  • tmpfs – You may have several of these. These are used by /run and other Linux processes as temporary filesystems for running the operating system. For example, the tmpfs /run/lock is used to create lockfiles. These are the files that prevent multiple users from changing the same file at the same time.
 
Top