We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
command sets the field separator to the pipe character |, and then sorts the file based on the values in the second column, in descending numeric order.
The -k2 specifies the second column, the r tells sort to sort in reverse order, and the n specifies that a numeric sort should be used for values in that column.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
'Sort' command #7
You are viewing a single comment's thread. Return to all comments →
command sets the field separator to the pipe character
|
, and then sorts the file based on the values in the second column, in descending numeric order. The-k2
specifies the second column, ther
tells sort to sort in reverse order, and then
specifies that a numeric sort should be used for values in that column.