How do you grep unique values in Linux?

How do you grep unique values in Linux?
Answer
Solution:
  1. Using grep and head command. Pipe the output of grep command to head command to get the first line. …
  2. Using m option of grep command. The m option can be used to display the number of matching lines. …
  3. Using the sed command. We can also use the sed command to print unique occurrence of a pattern. …
  4. Using awk command.
 

Tìm kiếm

Back
Top