Need Generic command for Memory usuage on Linux and Solaris

Hi,

I m using the below commands to find out the RAM and SWAP Memory usage on Linux.

free -m
 

while I m using the below for Solaris

prstat -cZ 1 1 

Is there a generic command that I can used for both Linux and Solaris to get RAM and SWAP memory usage ?

Hello mohtashims,

Could you please try top command and let us know if this helps you.

Thanks,
R. Singh

I do not wish to use third party tools like top .

Is there another common tool trick to obtain this information on both Solaris and Linux.

System memory measurement is different on each OS.
If you want to measure virtual memory (RAM + swap, where alert thresholds make sense, in contrast to RAM alone and swap alone) then you can use the vmem.sh from my Nagios plugins for all LUnix.
If you don't have Nagios then you'll want to tweak the script output for your needs.