How to check disk space in Linux
2018-08-30 ONE NET WIKI
1. Check File System Disk Space Usage
The “df” command displays the information of device name, total blocks, total disk space, used disk space, available disk space and mount points on a file system.
2. Display information of all File System Disk Space Usage
The same as above, but it also displays information of dummy file systems along with all the file system disk usage and their memory utilization.
3. Show Disk Space Usage in Human Readable Format
The df command provides an option to display sizes in Human Readable formats by using ‘-h’ which prints the results in human readable format (e.g., 1K 2M 3G).
4. Display information of /home File System
To see the information of only device /home file system in human readable format use the following command.
df -hT /home
5. Display information of File System in Bytes
To display all file system information and usage in 1024-byte blocks, use the option ‘-k‘ (e.g. –block-size=1K) as follows.
6. Display information of File System in MB
To display information of all file system usage in MB (Mega Byte) use the option as ‘-m‘.
7. Display information of File System in GB
To display information of all file system statistics in GB (Gigabyte) use the option as ‘df -h‘.
8. Display File System Inodes
Using ‘-i‘ switch will display the information of number of used inodes and their percentage for the file system.
9. Display File System Type
To check the file system type of your system use the option ‘T‘. It will display file system type along with other information.
10. Include Certain File System Type
If you want to display certain file system type use the ‘-t‘ option.
df -t ext4
11. Exclude Certain File System Type
If you want to display file system type that doesn’t belongs to ext3 type use the option as ‘-x‘.
12. Display information of df command.
Using ‘–help‘ switch will display a list of available option that are used with df command.