I often used the following command,
ps -eo pid,cmd,pcpu,pmem --sort=-pcpu | head
But in the
man page I saw the following to output modifiers,
--lines n Set screen height. --rows n Set screen height.
As if these modifiers can limit row height then I don't have to use any kind of piping which gives me a bit comfort on writing scripts with python subprocess.
But I have no idea how can I use them. As I have already tried adding them at the end of the command.