Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1741602
  • 博文数量: 782
  • 博客积分: 2455
  • 博客等级: 大尉
  • 技术积分: 4140
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-06 21:37
个人简介

Linux ,c/c++, web,前端,php,js

文章分类

全部博文(782)

文章存档

2015年(8)

2014年(28)

2013年(110)

2012年(307)

2011年(329)

分类: LINUX

2011-09-07 11:19:22

-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[30959 0]
 ; cat file
I'm a student.
You are a teacher.
He is a farmer.
He is a farmer.
He is a farmer.
We are workers.
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[30959 0]
 ; awk '{ if (!seen[$0]++) { print $0; } }' file
I'm a student.
You are a teacher.
He is a farmer.
We are workers.
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[30959 0]
 ; bye





cax@ibm:~/Desktop> cat a
I'm a student.
You are a teacher.
He is a farmer.
He is a farmer.
He is a farmer.
We are workers.
cax@ibm:~/Desktop> cat  a | sort
He is a farmer.
He is a farmer.
He is a farmer.
I'm a student.
We are workers.
You are a teacher.
cax@ibm:~/Desktop> cat  a | sort | uniq
He is a farmer.
I'm a student.
We are workers.
You are a teacher.
阅读(842) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~