home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / admin / 6271 < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.1 KB  |  66 lines

  1. Newsgroups: comp.unix.admin
  2. Path: sparky!uunet!think.com!ames!nsisrv!thuja!karl
  3. From: karl@thuja.gsfc.nasa.gov (Karl A. Anderson)
  4. Subject: Re: RAM size
  5. Message-ID: <1992Nov19.191956.2748@nsisrv.gsfc.nasa.gov>
  6. Sender: karl@thuja (Karl A. Anderson)
  7. Nntp-Posting-Host: thuja.gsfc.nasa.gov
  8. Organization: NASA/GSFC Laboratory for Terrestrial Physics
  9. References: <MENJAN.92Nov17221015@ra.cs.umb.edu> <1992Nov19.140503.13218@tinman.mke.ab.com>
  10. Distribution: comp
  11. Date: Thu, 19 Nov 1992 19:19:56 GMT
  12. Lines: 52
  13.  
  14. In article <1992Nov19.140503.13218@tinman.mke.ab.com>, tdphette@mke.ab.com (Thad Phetteplace x4461) writes:
  15. |> menjan@cs.umb.edu (Men-Jan Lin) writes:
  16. |> : 
  17. |> : How can I know the RAM size of my Sun and HP workstation ?
  18. |> : (not reboot)
  19. |> : Thanks.
  20. |> : 
  21. |> : -Jane
  22. |> 
  23. |> On a Sun you can run the dmesg command and print the messages from the
  24. |> last boot. The RAM size should be in there.  Pipe it to 'grep mem' to
  25. |> filter out other messages...
  26. |> 
  27. |> dmesg | grep mem
  28. |> 
  29. |> That should do it.  I don't know if you can do the same on an HP.
  30. |>  
  31.  
  32. Dmesg also works on an HP, but you have to be super-user.  Also, on a Sun you
  33. can use devinfo(8).  Here's a script somebody posted a while ago:
  34.  
  35. karl@thuja% cat showmem
  36. #!/bin/sh
  37.  
  38. calc_memory () {
  39.         # now at start of memory section, dump the next two lines
  40.         line >/dev/null
  41.         line >/dev/null
  42.  
  43.         TOTAL_MEM=0;
  44.         read LINE
  45.         # until the line does not have Size on it ...
  46.         until echo $LINE | egrep -v "Size" >/dev/null
  47.         do
  48.                 MEM=`echo $LINE | cut -d= -f4`
  49.                 TOTAL_MEM=`echo 16 o 16 i $MEM $TOTAL_MEM + p | dc`
  50.                 read LINE
  51.         done
  52.         # divide to get figure in megs instead of bytes
  53.         TOTAL_MEM=`echo 16 i $TOTAL_MEM 100000 / p | dc`
  54.         echo $TOTAL_MEM megs
  55. }
  56. # send output of devinfo, from the line with 'memory' on to the above function
  57. devinfo -v | sed -n '/\'memory\'/,\$p'' | calc_memory
  58.  
  59. karl@thuja% showmem
  60. 64 megs
  61.  
  62. -- 
  63. Karl A. Anderson        | Internet: karl@thuja.gsfc.nasa.gov
  64. NASA/GSFC code 920.2 (HSTX)    | voice: (301) 286-3815
  65. Greenbelt, MD 20771        | #include "std_disclaimer"
  66.