Linux df命令详解
df命令的功能是用来检查linux服务器的文件系统的磁盘空间占用情况。
df常见命令参数
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | -a, --all include dummy file systems -B, --block-size=SIZE use SIZE-byte blocks --direct show statistics for a file instead of mount point --total produce a grand total -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) |
常用的命令展示:
显示所有磁盘空间占用情况
1 | df -ha 【-a 显示所有】 |
注意: tmpfs 是一个不存在于实体硬盘上、而是驻在记忆里的特殊文件系统。其中一个副作用就是当你失去电源(或重就开机)时,tmpfs 上的一切内容都会消失。tmpfs 驻守在内存里,它的速度极快。它的寻觅时间与驻守在硬盘上的一般文件系统根本不能相比。
mount -t tmpfs tempfilesystem /mnt/tmpfs 【手动挂载tmpfs文件系统】
以inode模式显示磁盘使用情况
1 | [root@localhost omc] # df -i |
显示指定类型磁盘
1 | [root@localhost omc] # df -ht ext4 |
列出文件系统的类型【常用】
1 | [root@localhost omc] # df -h |
作者:小a玖拾柒
-------------------------------------------
个性签名: 所有的事情到最後都是好的,如果不好,那說明事情還沒有到最後~
本文版权归作者【小a玖拾柒】和【博客园】共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利!
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步