- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to check total space and available space in Linux using the terminal?
In the Linux/Unix system to check storage details, we use the df command.
df (disk free) command
the df command is used to report file system disk space usage using the terminal in the Linux system. It displays total space, used space, and available space.
The general syntax of the df command is as follow:
$ df [OPTION]... [FILE]...
Brief description of options available in the df command.
|Sr.No.||Option & Description|
Include duplicate, pseudo, inaccessible file systems
Scale sizes before printing
Display sizes in powers of 1024
Display sizes in powers of 1000
Limit listing to local file systems
Don’t synchronize before getting usage info
Synchronize before getting usage info
Display file system type
Limit listing to the file systems not of specified type
Displays a help message and then exits.
It gives info about the version and then exits.
To check space usage, we use the df command. By default, it is hard to understand the output of the df command.
The below snapshot is the output screen after the execution of the df command in the Linux system.
We can see that /dev/sda5 (root partition) 9736500 have total size 5813352 have used size and 3408844 have available size but what are these numbers? These numbers don’t have any units so we can’t understand.
Make it human readable there is an option available -h or --human-readable that makes it readable.
To display output in human readable format, we use -h or --human-readable option with the df command as shown in below.
$ df --human-readable
$ df -h
After executing above command, it reports the disk space usage in human readable form then we can easily understand disk space usage.
Display storage details in powers of 1000 (e.g., 32.3G).
To display output in powers of 1000, we use -H or --si option with the df command in the Linux system using terminal
$ df --si
$ df -H
After executing above command, it reports the disk space usage in powers of 1000. Now we can easily understand disk space usage because we are more familiar with GB.
For more details about df command and check option description use below command.
$ df --help
And check the version information of df command use below command.
$ df --version
- How to Check available space on Android devices using Kotlin?
- How to check available space on Android Device?
- How to find out which processes are using swap space in Linux?
- How to Increase Swap Space on Linux Ubuntu?
- Get the total space of this partition in Java
- How to decorate your Linux Terminal using Shell?
- How to create a new directory in Linux using the terminal?
- How to create key binds in the Linux system using the terminal?
- How to remove files and directories in the Linux operating system using the terminal?\n
- How to Create a File in the Linux/Unix system using terminal?
- Bootstrap 4 class for a single flex item to take up the available space
- How to add space between characters in IText using FabricJS?
- How to add space between characters in Text using FabricJS?
- Formatted text in Linux Terminal using Python
- Check if the String contains only unicode letters and space in Java