How to find the size of a HDFS file

Viewed 112426

How to find the size of a HDFS file? What command should be used to find the size of any file in HDFS.

8 Answers
hdfs dfs -du -s -h /directory

This is the human readable version, otherwise it will give in bad units (slight bigger)

In case if you want to know the each files size inside the directory then use the '*' asterisk at the end.

hadoop fs -du -s -h /tmp/output/*

I hope this helps your purpose.

Try this $ hadoop fs -count -t /hdfs-file-path or $ hdfs dfs -count -t /hdfs-file-path

Related