The way to check a HDFS directory's size?

前端 未结 10 722
轻奢々
轻奢々 2021-01-30 12:14

I know du -sh in common Linux filesystems. But how to do that with HDFS?

10条回答
  •  情深已故
    2021-01-30 12:56

    Command Should be hadoop fs -du -s -h \dirPath

    • -du [-s] [-h] ... : Show the amount of space, in bytes, used by the files that match the specified file pattern.

    • -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. (Ex MB/GB/TB etc)

      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)

提交回复
热议问题