home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.admin
- Path: sparky!uunet!think.com!ames!nsisrv!thuja!karl
- From: karl@thuja.gsfc.nasa.gov (Karl A. Anderson)
- Subject: Re: RAM size
- Message-ID: <1992Nov19.191956.2748@nsisrv.gsfc.nasa.gov>
- Sender: karl@thuja (Karl A. Anderson)
- Nntp-Posting-Host: thuja.gsfc.nasa.gov
- Organization: NASA/GSFC Laboratory for Terrestrial Physics
- References: <MENJAN.92Nov17221015@ra.cs.umb.edu> <1992Nov19.140503.13218@tinman.mke.ab.com>
- Distribution: comp
- Date: Thu, 19 Nov 1992 19:19:56 GMT
- Lines: 52
-
- In article <1992Nov19.140503.13218@tinman.mke.ab.com>, tdphette@mke.ab.com (Thad Phetteplace x4461) writes:
- |> menjan@cs.umb.edu (Men-Jan Lin) writes:
- |> :
- |> : How can I know the RAM size of my Sun and HP workstation ?
- |> : (not reboot)
- |> : Thanks.
- |> :
- |> : -Jane
- |>
- |> On a Sun you can run the dmesg command and print the messages from the
- |> last boot. The RAM size should be in there. Pipe it to 'grep mem' to
- |> filter out other messages...
- |>
- |> dmesg | grep mem
- |>
- |> That should do it. I don't know if you can do the same on an HP.
- |>
-
- Dmesg also works on an HP, but you have to be super-user. Also, on a Sun you
- can use devinfo(8). Here's a script somebody posted a while ago:
-
- karl@thuja% cat showmem
- #!/bin/sh
-
- calc_memory () {
- # now at start of memory section, dump the next two lines
- line >/dev/null
- line >/dev/null
-
- TOTAL_MEM=0;
- read LINE
- # until the line does not have Size on it ...
- until echo $LINE | egrep -v "Size" >/dev/null
- do
- MEM=`echo $LINE | cut -d= -f4`
- TOTAL_MEM=`echo 16 o 16 i $MEM $TOTAL_MEM + p | dc`
- read LINE
- done
- # divide to get figure in megs instead of bytes
- TOTAL_MEM=`echo 16 i $TOTAL_MEM 100000 / p | dc`
- echo $TOTAL_MEM megs
- }
- # send output of devinfo, from the line with 'memory' on to the above function
- devinfo -v | sed -n '/\'memory\'/,\$p'' | calc_memory
-
- karl@thuja% showmem
- 64 megs
-
- --
- Karl A. Anderson | Internet: karl@thuja.gsfc.nasa.gov
- NASA/GSFC code 920.2 (HSTX) | voice: (301) 286-3815
- Greenbelt, MD 20771 | #include "std_disclaimer"
-