Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4732781
  • 博文数量: 930
  • 博客积分: 12070
  • 博客等级: 上将
  • 技术积分: 11448
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-15 16:57
文章分类

全部博文(930)

文章存档

2011年(60)

2010年(220)

2009年(371)

2008年(279)

分类:

2008-09-04 21:00:07

sort实现,sort -m可以合并已经排好序了的文件

:sort -m <(sort file1 | uniq) <(sort file2 | uniq) | uniq
:sort -m <(sort file1 | uniq) <(sort file2 | uniq) | uniq -d
:sort -m <(sort file1 | uniq) <(sort file2 | uniq) <(sort file2 | uniq) | uniq -u

逛论坛发现的其它方法

     grep -f file1 file2
      第一个文件有而第二个文件没有的
     grep -fv file1 file2
      两个文件的并集
    cat file1 file2 | sort | uniq > file3

阅读(821) | 评论(0) | 转发(0) |
0

上一篇:还是百度滴

下一篇:tar bak详解

给主人留下些什么吧!~~