Show only lines that appear more than x times. (shell script)

Asked

Viewed 147 times

1

I am analyzing a log file and I wanted to filter only lines that appear more than 10 times inside the file. Only I’m not finding a way to make this filter. inserir a descrição da imagem aqui

1 answer

2


You will use the following command:

sort SeuArquivo | uniq -c

If you still want to sort by the number of occurrences use:

sort SeuArquivo | uniq -c | sort -nr
  • +1 eventually ... | awk '$1 > 10 {print $2}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.