Hadoop HDFS命令学习笔记

cat

Usage: hadoop fs -cat [-ignoreCrc] URI [URI ...]

Copies source paths to stdout.

Options

  • The -ignoreCrc option disables checkshum verification.

Example:

  • hadoop fs -cat hdfs://nn1.example.com/file1 hdfs://nn2.example.com/file2
  • hadoop fs -cat file:///file3 /user/hadoop/file4

Exit Code:

Returns 0 on success and -1 on error.

eg:

hadoop fs -cat /work/songwang4/kg/repair/result/sourceMovie/res/part* | grep results | wc -l

查看该路径下文件中含有多少 results字段

猜你喜欢

转载自www.cnblogs.com/hanhaotian/p/9441062.html