The way to check a HDFS directory's size?

Cheng picture Cheng · Jun 28, 2011 · Viewed 161.2k times · Source

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

Answer

Matt D picture Matt D · Jun 28, 2011

Prior to 0.20.203, and officially deprecated in 2.6.0:

hadoop fs -dus [directory]

Since 0.20.203 (dead link) 1.0.4 and still compatible through 2.6.0:

hdfs dfs -du [-s] [-h] URI [URI …]

You can also run hadoop fs -help for more info and specifics.