使用密集试存储作业

使用hadoop载平衡

以空格拆分

[root@hadoop ~]# cat hello.txt |xargs -n 1|sort
beijing
dongguan
guangzhou
hello
hello
hello
hello
jili
shagnhai
shenzhen

以空格拆分后去重

[root@hadoop ~]# cat hello.txt |xargs -n 1|sort |uniq
beijing
dongguan
guangzhou
hello
jili
shagnhai
shenzhen

以空格拆分后去重,统计各行在文件中出现的次数

[root@hadoop ~]# cat hello.txt |xargs -n 1|sort |uniq -c
      1 beijing
      1 dongguan
      1 guangzhou
      4 hello
      1 jili
      1 shagnhai
      1 shenzhen