要查看Hadoop文件,可以使用以下指令:
hadoop fs -ls <路徑>
示例:
hadoop fs -ls /user/hadoop/input
hadoop fs -cat <文件路徑>
示例:
hadoop fs -cat /user/hadoop/input/file.txt
hadoop fs -tail <文件路徑>
示例:
hadoop fs -tail /user/hadoop/input/file.txt
hadoop fsck <文件路徑> -files -blocks -locations
示例:
hadoop fsck /user/hadoop/input/file.txt -files -blocks -locations
hadoop fs -ls -R <文件路徑>
示例:
hadoop fs -ls -R /user/hadoop/input