I want top to just give me the results when I call it and then exit. How can this be done?
top
top's manpage does not list any flag for this purpose.
Also, I do not want to use ps -eLf for the purpose.
ps -eLf
From the top manpage:
-n : Number of iterations limit as: -n number Specifies the maximum number of iterations, or frames, top should produce before ending.
So just run:
top -n 1