There is a file ip.txt, one IP record per line, a total of several lines, which of the following commands can be used to "count the top 3 IPs with the most occurrences and their numbers"? ()
A, uniq -c ip.txt
B, sort -nr ip.txt | uniq -c | sort -nr | head -n 3
C, cat ip.txt | count -n | sort -rn | head -n 3
D, cat ip.txt | count -n
Answer:B
There is a file ip.txt, one IP record per line, a total of several lines, which of the following commands can be used to "count the top 3 IPs with the most occurrences and their numbers"? ()
A, uniq -c ip.txt B, sort -nr ip.txt | uniq -c | sort -nr | head -n 3 C, cat ip.txt | count -n | sort -rn | head -n 3 D, cat ip.txt | count -n