Javatpoint Logo
Javatpoint Logo

Linux uniq

With the help of uniq command you can form a sorted list in which every word will occur only once.

Syntax:

Example:

Linux Uniq Filters1

Look at the above snapshot, words which are repeating, repeats only once with the 'uniq' command.


uniq -c

You can count the number of occurences of a word with 'uniq -c' command.

Syntax:

Example:

Linux Uniq Filters2

Look at the above snapshot, command "sort dupli.txt | uniq -c" counts the number of times a word is repeating.

Next TopicLinux wc




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA