Archive

Posts Tagged ‘command’

FreeBSD Get CPU & Memory Information

July 21st, 2010 No comments

beastieTo get information about CPU and Memory under FreeBSD use the following commands:

Getting CPU information:
From dmesg:

$ dmesg | grep CPU

Or

$ grep CPU /var/run/dmesg.boot | less

Using sysctl:
CPU model:

$ sysctl hw.model

CPU clock rate:

$ sysctl hw.clockrate

No of cpus:

$ sysctl hw.ncpu

Get all information:

$ sysctl -a | grep -i cpu | less

Getting memory information:
From dmesg:

$ dmesg | grep memory

Or

$ grep memory /var/run/dmesg.boot

Using sysctl:

$ sysctl -a | grep mem | less


FreeBSD find out memory usage

There is a Linux like free command for FreeBSD. You can get it from https://github.com/vinod85/free.

$ git clone https://github.com/vinod85/free.git
$ cd free; make
$ sudo mv free /usr/local/bin/free
$ free -m -t

Output

                   total          active            free        inactive            wire          cached
Memory:             1917              59            1053             575             111              41
Summary:            1917             246            1670

Freecolor is a free replacement that displays free memory graphically as a bargraph. It supports the same options as free. Install freecolor, enter:

# pkg_add -r freecolor

To see memory details, enter:

# freecolor -m

Output

Physical  : [#######################............] 67% (162/239)
Swap      : [##################################.] 99% (599/600)
# freecolor -m -o

Output:

             total       used       free     shared    buffers     cached
Mem:           239         77        162          0          0          0
Swap:          600          0        599
Categories: FREEBSD Tags: , ,