How to find unique fields in a tab delimited file in Linux

0
33

Use cut, sort & uniq commands to do the same

cat file_name| cut -f 1 | sort | uniq

will display values in field1 ,same way you can replace 1 with 2,3 etc…

Toget the unique occurrences you can make use of wc command as

cut -f 1 file_name| sort | uniq | wc -l

LEAVE A REPLY

Please enter your comment!
Please enter your name here