Sort numerical value using the sort command
Answer:
Assume you have a text file contains the following content:
1
2
3
10
When you use the sort command to sort them, it will give the following output:
# sort test.txt
1
10
2
3
So you need to sort them according to the numerical values?
Try with the n flag:
# sort -n test.txt
1
2
3
10