【发布时间】:2017-05-07 10:38:30
【问题描述】:
我正在尝试在 hadoop 文件系统的给定目录中查找最大的文件。我找到了这个链接:http://www.tecmint.com/find-top-large-directories-and-files-sizes-in-linux/,它显示了以下查找最大文件的命令:
find /home/tecmint/Downloads/ -type f -exec du -Sh {} + | sort -rh | head -n 5
但是当我跑的时候
hadoop fs -find [hadoop location] -type f -exec du -Sh {} + | sort -rh | head -n 5
我收到了find: Unexpected argument: -type。
我也运行了hadoop fs -du -a | sort -n | head -n 1,但我得到的结果不是目录中最大的文件。将不胜感激。
【问题讨论】:
-
你试过
hadoop fs -ls -S |head -1吗?我不使用 hadoop,我不确定 ls 是否存在 -S。
标签: bash hadoop directory find large-files