The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: sorting doubt
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 11-21-2008
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by abhishekarun123 View Post
HI,
I would like to know if there if any sorting command which uniquifies the list but does not arrange in alphabetical order.
ex- I have
b
b
a
b

Output I want is :
b
a

I am trying sort -u and this does the sorting in alphabetical order.

Please help friends
Are you open to awk ? If so, try

Code:
awk '!x[$1]++' list.txt