Member Avatar for MarkQ97

How do I sort a text file which has been listed already by size order, then take that list and put it into reverse alphabetical order?

@MarkQ97
If I want to sort a file I can do this with a pipe.
cat file | sort -r > newfile

The sort flags are picked as you wish and my crude example is just that.

Your reply about a directory seems odd but I take it you need a reminder of Linux command lines. One can also not pipe but redirect like:
sort -r < file > newfile

And for more fun you can get the last so many lines with tail then sort like:
tail file|sort -r > newfil

Isn't it an example of UUOC ? It seems to me that sort -r -o newfile file should work.

commented: Some folk need to see more examples. even sort -r file.txt should work but they may be quite new to the command line. +6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.