top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to sort output of a command in reverse order in Linux or UNIX ?

+2 votes
601 views
How to sort output of a command in reverse order in Linux or UNIX ?
posted Jun 10, 2014 by Kapil Kapoor

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Can you please elaborate your question a bit more ?

1 Answer

+2 votes

"sort -r" option allow us to perform reverse sorting in Unix/Linux.

Now suppose you have the following command

$ cat myfile.txt 

And you want to do the reverse sort of the output of this then u can try

$ cat myfile.txt | sort -r
answer Jun 11, 2014 by Salil Agrawal
Similar Questions
0 votes

Write a unix command to display the every character in the word "QUERYHOME" in new line.

Ex : Input - QUERYHOME
output: Q
U
E
R
Y
H
O
M
E

...