Hadoop命令:查找包含特定字符的行
在常见的 Hadoop 命令中,查找 Hadoop 系统中已存在并且在 /tmp/1.txt 文件中包含字符'111' 的行的命令是()
A. hdfs -cat /tmp/1.txt | grep 111
B. hdfs dfs -cat 1.txt | grep 111
C. cat 1.txt | grep 111
D. hdfs dfs -cat /tmp/1.txt | grep 111
答案:D.
解释:
- hdfs dfs -cat /tmp/1.txt 命令用于从 HDFS 中读取 /tmp/1.txt 文件的内容。
- grep 111 命令用于在输出中查找包含 '111' 字符的行。
因此,只有选项 D 是正确的。
原文地址: https://www.cveoy.top/t/topic/nXMd 著作权归作者所有。请勿转载和采集!