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 ?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityI 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 ?
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.