← Useful Tips
Linux / WSLLinux

sort file | uniq -c | sort -nr: Count repeated values and sort by frequency

Use sort file | uniq -c | sort -nr to count repeated values and sort by frequency. It is especially handy when you live in terminals and repeat long commands.

sort file | uniq -c | sort -nr

Why it helps

Use sort file | uniq -c | sort -nr to count repeated values and sort by frequency. It is especially handy when you live in terminals and repeat long commands.

How to use it

  1. Open the relevant app or terminal.
  2. Use the shortcut or command above in the relevant context.
  3. Check the result; for commands that change data, test on a small example first.
People also search for
sort file | uniq -c | sort -nr: Count repeated values and sort by frequencysort file | uniq -c | sort -nrcount repeated values and sort by frequencyhow to count repeated values and sort by frequencyLinux / WSL count repeated values and sort by frequency

Related tips