How to sort using awk ?

I need to sort the following row using the awk. How can I sort using the third column in descending/ascending order ?

host6  dev406mum.dd.mum.test.com          22               11               11               no
host7  dev258mum.dd.mum.test.com          36               17               19               no
host7  dev273mum.dd.mum.test.com          41               23               18               no
host7  dev296mum.dd.mum.test.com          41               15               26               no
host7  dev339mum.dd.mum.test.com          61               20               41               no
host4  dev271mum.dd.mum.test.com          27               21               6                no
host4  dev299mum.dd.mum.test.com          12               11               1                no
beer9Asked:
Who is Participating?
 
leh327Connect With a Mentor Commented:
if you have access to "sort", the syntax is
sort -k 3 -n -r

-k 3 - for third field
-n - for numeric sort
-r - for descending
0
 
beer9Author Commented:
Thanks, it works for me! :)
0
 
beer9Author Commented:
Thanks! :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.