I have a string "abc" and I am greping it in 15 files in my directory in shell. When I grep "abc" in my 15 files than it returns me the whole line of the files in which its present like this:
abc 0.2 9.0 abc 0.01 8.0 abc 0.06 9.4 abc 0.02 8.7 Now I want this output to be sorted in ascending order according to the second column.
So I wrote the command like this:
grep "abc" *.txt | sort -nr -t_ -k2 but the above command is not working and I don't know why.