Saturday, 2 January 2016

Hadoop: du: displays amount of space used by files

“du” command displays sizes of files and directories contained in the given directory.

Usage:
hadoop fs [generic options] -du [-s] [-h] <path> ...

The -s option will result in an aggregate summary of file lengths being displayed.

The -h option will format file sizes in a “human-readable” fashion.
 

$hadoop fs -du -h /user/cloudera
29.8 M  29.8 M  /user/cloudera/demo1
8.7 M   8.7 M   /user/cloudera/demo2
2.5 K   2.5 K   /user/cloudera/demo3
92      92      /user/cloudera/demo4
4.5 M   4.5 M   /user/cloudera/putDemo
$
$hadoop fs -du -h /user/cloudera/demo1
5.9 M  5.9 M  /user/cloudera/demo1/atlas.docx
8.7 M  8.7 M  /user/cloudera/demo1/atlasClient.docx
6.7 M  6.7 M  /user/cloudera/demo1/gradle.docx
8.6 M  8.6 M  /user/cloudera/demo1/maven.docx


Previous                                                 Next                                                 Home

No comments:

Post a Comment