How can I display the
top results in my terminal in real time so that the list is sorted by memory usage?
Use quick tip using top command in linux/unix
hit Shift + f , then choose the display to order by memory usage by hitting key n then press Enter. You will see active process ordered by memory usage.
Or you can just press M after running
The command line option
which sorts by the column
I don't know why or how but this is pretty much different between Unix systems and even between Linux distributions. For example