谁能说出du命令为什么不列出每个子目录的磁盘空间量?
-bash-4.1$ df -H /dev/mapper/VolGroup00-lv_root
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-lv_root
9.7G 8.4G 810M 92% /
-bash-4.1$ sudo du -sh /dev/mapper/VolGroup00-lv_root
0 /dev/mapper/VolGroup00-lv_root
答案 0 :(得分:1)
-s
的{{1}}选项说来总结参数,而不会显示子目录的利用率。
但是,您在设备名称上运行命令。您需要安装该设备并运行du
来列出所有子目录的使用情况(深度= 1)。
我怀疑此设备用于您的根文件系统du -h -d 1 /mnt
,因此只需运行:
/
du -h -d 1 /
返回:
du --version
[johnma@johnma-E6430 ~]$ du --version
du (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund, David MacKenzie, Paul Eggert,
and Jim Meyering.
返回:
du --help