查看一下
du
指令的说明:[root@master ~]# hadoop fs -help du
-du [-s] [-h] <path> ... :
Show the amount of space(显示空间大小), in bytes(单位:bytes), used by the files that match the specified
file pattern. The following flags are optional:
-s (显示文件夹的总大小,不显示子文件情况)Rather than showing the size of each individual file that matches the
pattern, shows the total (summary) size.
-h (换一种单位,方便显示)Formats the sizes of files in a human-readable fashion rather than a number
of bytes.
Note that, even without the -s option, this only shows size summaries one level
deep into a directory.
The output is in the form
size name(full path)
演示:
hadoop fs -du /mz
hadoop fs -du -s -h /mz