I want to determine via cli how much memory seamonkey is using.

I know pidof seamonkey will give me the needed pid.

How do I combine that with os -o rss to give the memory used ?

  • System monitor must display that – Kulfy Aug 7 '18 at 19:29
  • Editing my post. I wanted it via cli. – fixit7 Aug 7 '18 at 20:11

From man ps:

-q pidlist  
    Select by PID (quick mode).
    This selects the processes whose process ID numbers appear in pidlist.

To combine this with ps -o rss, use command subtitution:

ps -o rss -q $(pidof seamonkey)

Or the old-fashioned style with backquotes:

ps -o rss -q `pidof seamonkey`

You may want to add --no-headers if you are only interested in getting the number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.