Shantanu Oak
Oct. 2nd, 2008
05:57 pm - Sorting in Linux
[root@localhost ~]# cat testme.txt
this is a test
food that are killing you
wings of fire
we hope that the labor spent in creating this software
this is a test
unix ips as well as enjoy our blog
[root@localhost ~]# awk '!x[$0]++' testme.txt
this is a test
food that are killing you
wings of fire
we hope that the labor spent in creating this software
unix ips as well as enjoy our blog
[root@localhost ~]# sort -u testme.txt
food that are killing you
this is a test
unix ips as well as enjoy our blog
we hope that the labor spent in creating this software
wings of fire
[root@localhost ~]# sort testme.txt | uniq -u
food that are killing you
unix ips as well as enjoy our blog
we hope that the labor spent in creating this software
wings of fire
Current Mood: geeky
