Extending to Matt D and others answers, the command can be till Apache Hadoop 3.0.0
hadoop fs -du [-s] [-h] [-v] [-x] URI [URI ...]
它显示给定目录中包含的文件和目录的大小,或者文件的长度,以防它只是一个文件。
选择:
The 是的 option will result in an 文件长度汇总汇总 being displayed, rather than the individual files. Without the -s option, the calculation is done by going 1-level deep from the given path.
The - 哦 option will format file sizes in a 人类可读 fashion (e.g 64.0m instead of 67108864)
-count [-q] [-h] [-v] [-t [<storage type>]] [-u] <path> ... :
Count the number of directories, files and bytes under the paths
that match the specified file pattern. The output columns are:
DIR_COUNT FILE_COUNT CONTENT_SIZE PATHNAME
or, with the -q option:
QUOTA REM_QUOTA SPACE_QUOTA REM_SPACE_QUOTA
DIR_COUNT FILE_COUNT CONTENT_SIZE PATHNAME