如何查找HDFS文件的大小 [英] How to find the size of a HDFS file

查看:130
本文介绍了如何查找HDFS文件的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到HDFS文件的大小?应该用什么命令来查找HDFS中任何文件的大小。

可以使用 hadoop fs -ls 命令列出当前目录中的文件及其详细信息。命令输出中的第5列包含文件大小(字节)。

命令 hadoop fs -ls input 给出以下输出:

 找到1项
-rw-r - r-- 1 hduser supergroup 45956 2012-07-19 20:57 / user / hduser / input / sou

文件 sou 的大小为45956字节。


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

解决方案

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.

这篇关于如何查找HDFS文件的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆