Example list sorted from left to right.
DATA2 DATA4 FILE1 FILE3
Example list sorted from right to left.
FILE1 DATA2 FILE3 DATA4
How do I do this?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
cat file | rev | sort | rev
Where file contains the content needing to be sorted.
$ cat file DATA2 DATA4 FILE1 FILE3
$ cat file | rev | sort | rev FILE1 DATA2 FILE3 DATA4
All it does is reverse each line before applying sort, then reverses each line back again.