12 Useful “df” Commands to Check Disk Space in Linux
On the internet you will find plenty of tools for checking disk space utilization in Linux. However, Linux has a strong built in utility called ‘df‘. The ‘df‘ command stand for “disk filesystem“, it is used to get full summary of available and used disk space usage of file system on Linux system.
Using ‘-h‘ parameter with (df -h) will shows the file system disk space statistics in “human readable” format, means it gives the details in bytes, mega bytes and gigabyte.

Useful df Command Examples
This article explain a way to get the full information of Linux disk space usage with the help of ‘df‘ command with their practical examples. So, you could better understand the usage of df command in Linux.
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.
[root@tecmint ~]# df Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p2 78361192 23185840 51130588 32% /
/dev/cciss/c0d0p5 24797380 22273432 1243972 95% /home
/dev/cciss/c0d0p3 29753588 25503792 2713984 91% /data
/dev/cciss/c0d0p1 295561 21531 258770 8% /boot
tmpfs 257476 0 257476 0% /dev/shm
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.
[root@tecmint ~]# df -a Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p2 78361192 23186116 51130312 32% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devpts 0 0 0 - /dev/pts
/dev/cciss/c0d0p5 24797380 22273432 1243972 95% /home
/dev/cciss/c0d0p3 29753588 25503792 2713984 91% /data
/dev/cciss/c0d0p1 295561 21531 258770 8% /boot
tmpfs 257476 0 257476 0% /dev/shm
none 0 0 0 - /proc/sys/fs/binfmt_misc
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
3. Show Disk Space Usage in Human Readable Format
Have you noticed that above commands displays information in bytes, which is not readable yet all, because we are in a habit of reading the sizes in megabytes, gigabytes etc. as it makes very easy to understand and remember.
The df command provides an option to display sizes in Human Readable formats by using ‘-h’ (prints the results in human readable format (e.g., 1K 2M 3G)).
[root@tecmint ~]# df -h Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p2 75G 23G 49G 32% /
/dev/cciss/c0d0p5 24G 22G 1.2G 95% /home
/dev/cciss/c0d0p3 29G 25G 2.6G 91% /data
/dev/cciss/c0d0p1 289M 22M 253M 8% /boot
tmpfs 252M 0 252M 0% /dev/shm
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.
[root@tecmint ~]# df -hT /home Filesystem Type Size Used Avail Use% Mounted on
/dev/cciss/c0d0p5 ext3 24G 22G 1.2G 95% /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.
[root@tecmint ~]# df -k Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p2 78361192 23187212 51129216 32% /
/dev/cciss/c0d0p5 24797380 22273432 1243972 95% /home
/dev/cciss/c0d0p3 29753588 25503792 2713984 91% /data
/dev/cciss/c0d0p1 295561 21531 258770 8% /boot
tmpfs 257476 0 257476 0% /dev/shm
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‘.
[root@tecmint ~]# df -m Filesystem 1M-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p2 76525 22644 49931 32% /
/dev/cciss/c0d0p5 24217 21752 1215 95% /home
/dev/cciss/c0d0p3 29057 24907 2651 91% /data
/dev/cciss/c0d0p1 289 22 253 8% /boot
tmpfs 252 0 252 0% /dev/shm
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‘.
[root@tecmint ~]# df -h Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p2 75G 23G 49G 32% /
/dev/cciss/c0d0p5 24G 22G 1.2G 95% /home
/dev/cciss/c0d0p3 29G 25G 2.6G 91% /data
/dev/cciss/c0d0p1 289M 22M 253M 8% /boot
tmpfs 252M 0 252M 0% /dev/shm
8. Display File System Inodes
Using ‘-i‘ switch will display the information of number of used inodes and their percentage for the file system.
[root@tecmint ~]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/cciss/c0d0p2 20230848 133143 20097705 1% /
/dev/cciss/c0d0p5 6403712 798613 5605099 13% /home
/dev/cciss/c0d0p3 7685440 1388241 6297199 19% /data
/dev/cciss/c0d0p1 76304 40 76264 1% /boot
tmpfs 64369 1 64368 1% /dev/shm
9. Display File System Type
If you notice all the above commands output, you will see there is no file system type mentioned in the results. To check the file system type of your system use the option ‘T‘. It will display file system type along with other information.
[root@tecmint ~]# df -T Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p2 ext3 78361192 23188812 51127616 32% /
/dev/cciss/c0d0p5 ext3 24797380 22273432 1243972 95% /home
/dev/cciss/c0d0p3 ext3 29753588 25503792 2713984 91% /data
/dev/cciss/c0d0p1 ext3 295561 21531 258770 8% /boot
tmpfs tmpfs 257476 0 257476 0% /dev/shm
10. Include Certain File System Type
If you want to display certain file system type use the ‘-t‘ option. For example, the following command will only display ext3 file system.
[root@tecmint ~]# df -t ext3 Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p2 78361192 23190072 51126356 32% /
/dev/cciss/c0d0p5 24797380 22273432 1243972 95% /home
/dev/cciss/c0d0p3 29753588 25503792 2713984 91% /data
/dev/cciss/c0d0p1 295561 21531 258770 8% /boot
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‘. For example, the following command will only display other file systems types other than ext3.
[root@tecmint ~]# df -x ext3 Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 257476 0 257476 0% /dev/shm
12. Display Information of df Command.
Using ‘–help‘ switch will display a list of available option that are used with df command.
[root@tecmint ~]# df --help Usage: df [OPTION]... [FILE]...
Show information about the file system on which each FILE resides,
or all file systems by default. Mandatory arguments to long options are mandatory for short options too.
-a, --all include dummy file systems
-B, --block-size=SIZE use SIZE-byte blocks
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
-H, --si likewise, but use powers of 1000 not 1024
-i, --inodes list inode information instead of block usage
-k like --block-size=1K
-l, --local limit listing to local file systems
--no-sync do not invoke sync before getting usage info (default)
-P, --portability use the POSIX output format
--sync invoke sync before getting usage info
-t, --type=TYPE limit listing to file systems of type TYPE
-T, --print-type print file system type
-x, --exclude-type=TYPE limit listing to file systems not of type TYPE
-v (ignored)
--help display this help and exit
--version output version information and exit SIZE may be (or may be an integer optionally followed by) one of following:
kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y. Report bugs to <bug-coreutils@gnu.org>.
Read Also :
12 Useful “df” Commands to Check Disk Space in Linux的更多相关文章
- 5 commands to check memory usage on Linux
Memory Usage On linux, there are commands for almost everything, because the gui might not be always ...
- Linux_Comand - Check disk space
df -h du -sh Delete folder older than 30 days find /path -name "test-*" -type d -mtime +30 ...
- 8 commands to check cpu information on Linux
https://www.binarytides.com/linux-cpu-information/
- 10 Useful du (Disk Usage) Commands to Find Disk Usage of Files and Directories
The Linux “du” (Disk Usage) is a standard Unix/Linux command, used to check the information of disk ...
- [转]Not enough free disk space on disk '/boot'
Not enough free disk space on disk '/boot' http://my.oschina.net/u/947673/blog/277224 # 解决 出现此情况是因为你 ...
- How to get the free disk space in PostgreSQL (PostgreSQL获取磁盘空间)
Get the current free disk space in PostgreSQL PostgreSQL获取磁盘空间 from eshizhan Here has a simple way t ...
- Disk Space Usage 术语理解:unallocated, unused and reserved
通过standard reports查看Disk Usage,选中Database,右击,选择Reports->Standard Reports->Disk Space Usage,截图如 ...
- 14.10.5 Reclaiming Disk Space with TRUNCATE TABLE 回收空间使用TRUNCATE TABLE
14.10.5 Reclaiming Disk Space with TRUNCATE TABLE 回收空间使用TRUNCATE TABLE 回收操作系统磁盘空间当truncate 一个InnoDB ...
- Android Studio模拟器磁盘空间不足(Not enough disk space to run AVD)
在Android Studio中运行模拟器时,提示Error: Not enough disk space to run AVD '....'. Exiting.是说安装模拟的磁盘空间不足,导致无法运 ...
随机推荐
- hihocoder #1301 : 筑地市场 数位dp+二分
题目链接: http://hihocoder.com/problemset/problem/1301?sid=804672 题解: 二分答案,每次判断用数位dp做. #include<iostr ...
- 设置DIV隐藏与显示,表格滑动条
问题描述: 现在希望使用JS设置DIV块的显示与隐藏,当某一个事件触发是,自动显示DIV块,显示表格数据,但是要求表格显示滑动条 问题解决: (1)DIV块的隐藏与显示 如上所示, ...
- 【POJ】【2987】Firing
网络流/最大权闭合子图 胡伯涛论文里有讲…… sigh……细节处理太伤心了,先是count和ans输出弄反了,改过来顺序时又忘了必须先算出来ans!要是不执行一下Dinic的话count就无意义了…… ...
- tangent space /handness
normal tangent bitangent 三者互相垂直. 组成一个tangent space 表示一个点 对于原本位置的偏移(扰动) 考虑到这是为了 normalmap做出虚假的normal来 ...
- Linux GPT分区
parted /dev/sdb //parted sdb磁盘 mklabel gpt //设置该磁盘分区为gpt mkpart primary 0% 100% //划分分区大 ...
- hibernate 多对多
HibernateHibernate多对多关联映射通常别拆分成两个多对一关联映射1. 下面的HostBean.UserBean.UserHostBean,UserHostBean是两个表之间的关联表, ...
- JsRender系列demo(4)-if else
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- js注册验证【转】
function getFocus() //设置用户名文本框获取焦点 { document.getElementById("txtuname").focus(); } functi ...
- IT 基础设施
http://www.cnblogs.com/wintersun/p/4355267.html
- lintcode 中等题: reverse linked list II 翻转链表II
题目 翻转链表 II 翻转链表中第m个节点到第n个节点的部分 样例 给出链表1->2->3->4->5->null, m = 2 和n = 4,返回1->4-> ...