How to find the size of a HDFS file

后端 未结 6 1242
抹茶落季
抹茶落季 2020-12-23 21:10

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

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-23 21:36

    You can use hadoop fs -ls command to list files in the current directory as well as their details. The 5th column in the command output contains file size in bytes.

    For e.g. command hadoop fs -ls input gives following output:

    Found 1 items
    -rw-r--r--   1 hduser supergroup      45956 2012-07-19 20:57 /user/hduser/input/sou
    

    The size of file sou is 45956 bytes.

提交回复
热议问题