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