查看Linux硬盘空间使用情况
命令以磁盘分区为单位查看文件系统中磁盘空间的使用情况
-h或--human-readable#使用人类可读的格式,这也是比较常见的查看方式
-i或--inode#查看分区inode使用情况 [whb@VM_0_12_centostest]$df :分区 注意:,因为系统会保留一部分空间用作他用 单纯使用命令,其实不利于我们直接查看分区中空间使用情况,所以我们更常用来进行查看,选项的意思是:使用人类可读的格式,这也是比较常见的查看方式 [whb@VM_0_12_centostest]$df-h FilesystemSizeUsedAvailUse%Mountedon列出所有的文件和目录容量大小而不仅仅列出目录容量大小 -s或--summarize#仅显示总计,只列出最后加总的值 -h或--human-readable#以K,M,G为单位,提高信息的可读性 -c或--total#除了列出文件和目录的容量大小外,最后在列出总容量 --max-depth=N方便测试,给大家建立了如下目录结构 [whb@VM_0_12_centostest]$tree. [whb@VM_0_12_centostest]$du#默认统计各个目录+目录下文件大小(目录容量),但只以目录形式显示 480https://www.fruan.com/post/dirx 400https://www.fruan.com/post/dir1/dir2 660https://www.fruan.com/post/dir1 1148. [whb@VM_0_12_centostest]$du-a#列出所有的文件大小和目录容量而不仅仅列出目录容量,默认只统计目录容量 4https://www.fruan.com/post/file.txt 476https://www.fruan.com/post/dirx/filex.txt 480https://www.fruan.com/post/dirx#这里为何是480?回看一下我们定义的概念,你就明白了 396https://www.fruan.com/post/dir1/dir2/file2.txt 400https://www.fruan.com/post/dir1/dir2 256https://www.fruan.com/post/dir1/file1.txt 660https://www.fruan.com/post/dir1 1148. 1148. [whb@VM_0_12_centostest]$du-h#以K,M,G为单位,提高信息的可读性 480Khttps://www.fruan.com/post/dirx 400Khttps://www.fruan.com/post/dir1/dir2 660Khttps://www.fruan.com/post/dir1 [whb@VM_0_12_centostest]$du-ah#选项可以组合 4.0Khttps://www.fruan.com/post/file.txt 476Khttps://www.fruan.com/post/dirx/filex.txt 480Khttps://www.fruan.com/post/dirx 396Khttps://www.fruan.com/post/dir1/dir2/file2.txt 400Khttps://www.fruan.com/post/dir1/dir2 256Khttps://www.fruan.com/post/dir1/file1.txt 660Khttps://www.fruan.com/post/dir1 [whb@VM_0_12_centostest]$du-hfile.txt除了列出文件和目录的容量大小外,最后在列出总容量 480https://www.fruan.com/post/dirx 400https://www.fruan.com/post/dir1/dir2 660https://www.fruan.com/post/dir1 [whb@VM_0_12_centostest]$du-ch 480Khttps://www.fruan.com/post/dirx 400Khttps://www.fruan.com/post/dir1/dir2 660Khttps://www.fruan.com/post/dir1 1.2M. [whb@VM_0_12_centostest]$du--max-depth=0-h 1.2M.#递归显示(仅仅是显示)时的递归深度小于等于N。--max-depth=0相当于-s参数 [whb@VM_0_12_centostest]$du--max-depth=1-h 480Khttps://www.fruan.com/post/dirx 660Khttps://www.fruan.com/post/dir1 [whb@VM_0_12_centostest]$du--max-depth=2-h 480Khttps://www.fruan.com/post/dirx 400Khttps://www.fruan.com/post/dir1/dir2 660Khttps://www.fruan.com/post/dir1 1.2M. 以上就是如何查看Linux硬盘空间使用情况的详细内容,更多请关注主机测评网其它相关文章! 本文来源:国外服务器--如何查看Linux硬盘空间使用情况(linux查看硬盘空间) 本文地址:https://www.idcbaba.com/guowai/2810.html 版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 1919100645@qq.com 举报,一经查实,本站将立刻删除。



