LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Re: Retrieve memory used of java process on HP-UX

[ILUG] Re: Retrieve memory used of java process on HP-UX

Francis Daly francisdaly at gmail.com
Mon May 29 23:32:43 IST 2006


On 29/05/06, Mark Clifford <markcliff at gmail.com> wrote:
> The top command looks like the correct value but how do i return it only
> through a shell script.

What arguments does your "top" accept?

-n 1 (one iteration only) will be helpful.
-b (batch mode) might be.
-u username or -U username (TFM) can save some post-processing.

You might also want a way to override .toprc, if your version supports
that. The aim is to get a consistent output format, of course.

When you've got the right number included in the output, either some
combination of grep and

tr -s ' ' | cut -d ' ' -f 5 (for suitable values of 5)

or awk to better confine the grep pattern matches should allow you to
isolate the number you want.

Whether "top" is the right tool is a separate question; if you're
happy that it is, then the above should allow you to use it.

All the best,

	f



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell