在/home/yuanqin/下建立file文件夹,再在文件夹建立file1.txt、file2.txt、file3.txt

file1内容:hello word

file2内容:hello hadoop 

file3内容:你好 你是谁 你好 我是袁琴

在hadoop目录下输入: bin/hadoop fs -mkdir input

bin/hadoop fs -put /home/yuanqin/file/file*.txt input

 bin/hadoop jar /home/yuanqin/Downloads/hadoop-1.2.1/hadoop-examples-1.2.1.jar wordcount input output

 

bin/hadoop fs -ls output

bin/hadoop fs -cat output/part-r-00000