How to Check Disk Space in Linux
In this how to guide, we will learn how to check available space left on Linux system.
We will be using terminal commands to check available hard disk space in Linux, so open you choice of terminal on your Linux system.
Check Linux Disk Space Using df Command
We can df command to check the available disk space. The df
command stands for disk free.
df
If you will run this command, then it will show data in 1 kilobytes blocks, which is pretty inconvenient for modern eyes, because majority of people are habitual of seeing the disk space in MBs or GBs, so in that case you can use -h
flag, as shown below:
df -h
It shows following columns:
- Filesystem: This is the name of the drive, and it includes physical hard drives, any temporary, virtual or logical drive by system.
- Size: Size of that perticular drive.
- Used: Total amount of space allocated to that perticular drive.
- Avail: Space left in that drive.
- Use%: Percentage of used space based on total allocated space to that drive.
- Mounted on: Physical folder location where that file system is located, generally referred as mount point.
In the mounted on field, you may see different list of filesystems which includes your physical hard drive, as well as virtual hard drives. Here is the detail:
- /dev/sda1: This is your physical hard drive. It may be listed as /sda0, /sda1, /sda2, or you may even have more. /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.
df
command is versatile with many more flags which you can use. This is the first go command for checking the disk space on Linux systems.
Leave a Reply