Anders,

On Tuesday 25 October 2005 09:09, Anders Johansson wrote:
> On Tuesday 25 October 2005 17:59, Daniel Hatfield wrote:
> > > > Is there a way to obtain the amount of physical memory
> > > > installed in a system from within SuSE 10 console? This is for
> > > > a script.
> > >
> > >   $ cat /proc/meminfo
> > >   MemTotal:     526525152 kB
> > >   [...]
> > >   $
> >
> > Or to be more specific:
> > cat /proc/meminfo | grep MemTotal
>
> Or to be even more specific
>
> cat /proc/meminfo | grep MemTotal|awk '{print $2}'

Or, to be more parsimonious:

% grep -h MemTotal /proc/meminfo |awk '{print $2}'


If I knew anything at all about awk, I'd know whether it could handle 
the selection (grep) part, too, but I don't.


Randall Schulz

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to