Computer scienceSystem administration and DevOpsCommand lineText processing

Sorting and deduplication

Sort by frequency

Report a typo

In this topic we sorted data by frequency with sort /tmp/test.txt | uniq -ci | sort -nrk1. Change the command a bit to display the result in ascending order.

Sample Input 1:

program
screen
c#
computer
program
c#
program

Sample Output 1:

1 computer
1 screen
2 c#
3 program
Write a program in Shell
#!/usr/bin/env bash
solve() {
# add your solution here

}
___

Create a free account to access the full topic