≡ Menu

FreeBSD CPU Information Command

How do I get more information about CPU under FreeBSD operating systems such as CPU Speed and model?

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
RequirementsNone
Estimated completion timeN/A
You can use the dmesg utility displays the contents of the system message buffer when FreeBSD comes up. For accuracy I recommend querying /var/run/dmesg.boot file. Usually a snapshot of the buffer contents taken soon after file systems are mounted at startup time and dumped to /var/run/dmesg.boot file.

Check CPU Speed in FreeBSD using sysctl command

Type the following command at a shell prompt as root user:
# sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
OR
# sysctl hw.model hw.machine hw.ncpu
Sample outputs:

hw.machine: amd64
hw.model: Intel(R) Xeon(R) CPU           X3220  @ 2.40GHz
hw.ncpu: 4
hw.machine_arch: amd64

From the outputs, I've an Intel Xeon quad core processor running at 2.40GHz. Here is another output from my FreeBSD based firewall server:

Fig. 01: Finding out CPU info on a FreeBSD server/router

Fig. 01: Finding out CPU info on a FreeBSD server/router

FreeBSD CPUINFO using the dmesg command

Type the following command:
# dmesg | grep -i cpu
Or directly query /var/run/dmesg.boot file:
# grep -i cpu /var/run/dmesg.boot
Sample outputs:

CPU: Dual Core AMD Opteron(tm) Processor 170 (1999.08-MHz 686-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
cpu0:  on acpi0
acpi_throttle0:  on cpu0
cpu1:  on acpi0
acpi_throttle1:  on cpu1
SMP: AP CPU #1 Launched!

You can also dump more information using sysctl command:
# sysctl -a | grep -i cpu | less

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 10 comments… add one }

  • Eugene Markow August 2, 2008, 4:39 am

    In ‘dmesg -a’, my cpu speed is clearly displayed as “CPU: AMD Athlon(tm) Processor (998.07-MHz 686-class CPU)”.

    When I used:

    ‘sysctl -a | egrep -i ‘hw.machine|hw.model|hw.ncpu’.

    the following was displayed:

    hw.machine: i386
    hw.model: AMD Athlon(tm) Processor
    hw.ncpu: 1
    hw.machine_arch: i386

    Why wasn’t the ‘speed’ of my processor displayed. It isn’t present anywhere in ‘sysctl -a’ either. Anyone know why? Thanks.

  • Paul March 12, 2009, 11:28 pm

    Thanks for the info, while the sysctl line didn’t work b/c it lacked the CPU speed grepping dmesg.boot worked like a charm.

  • Casey Hillman May 3, 2009, 7:21 pm

    Clockspeed is in sysctl, it is hw.clockrate

    ‘sysctl -a | grep hw.clockrate’

  • Chris LaFond August 5, 2009, 3:59 am

    Quick question,
    my output shows:
    palamon# sysctl -a | egrep -i ‘hw.machine|hw.model|hw.ncpu’
    hw.machine: i386
    hw.model: Intel(R) Pentium(R) 4 CPU 2.00GHz
    hw.ncpu: 1
    hw.machine_arch: i386

    with this, will my programs run slower for being compiled to run on a 386?
    should it be at least 686?
    Thanks

  • dev September 4, 2009, 5:54 pm

    is i386 32 and 64 bit capable?

  • Mr. Mead January 17, 2011, 3:35 pm

    ‘sysctl -a | grep hw.clockrate’
    seriously!?

    sysctl hw.clockrate

    kthxbye

  • me August 3, 2013, 1:25 pm

    no dude, you DON’T HAVE a cpu running at 2.4G
    you have a cpu that can run at 2.4G
    what’s the difference … hmmm … in linux

    cat /proc/cpuinfo | grep -i cpu
    cpu family : 6
    model name : Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz
    cpu MHz : 800.000
    cpu cores : 2
    cpuid level : 10
    cpu family : 6
    model name : Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz
    cpu MHz : 800.000
    cpu cores : 2
    cpuid level : 10

    so, it is running at 800MHz not 2.4GHz …

  • theManda January 17, 2014, 11:55 am

    more simple way

    sysctl hw.model hw.machine hw.ncpu
    hw.model: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
    hw.machine: amd64
    hw.ncpu: 8
  • Aakaash August 4, 2014, 4:09 am

    In that output:

    hw.machine: amd64
    hw.model: Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
    hw.ncpu: 4
    hw.machine_arch: amd64

    Why AMD and Intel are coming together? Sorry if this question is silly.

  • Ruben Schade December 20, 2014, 11:10 pm

    There’s a lot of confusion in the comments here. Given this page ranks highly in The Google, I’ll throw in my 20 cents (adjusted for inflation).

    “i386″ means 32bit, “amd64″ means 64bit. In brief, this is due to AMD having designed the original 64bit extensions for x86. Intel Core CPUs will still be listed as amd64 on the BSDs.

    In Linux, “/proc/cpuinfo” shows the capabilities of a CPU, but it may be throttling down for power saving. When you require the performance, it will revert to its full performance.

    There aren’t any silly questions. We learn by researching and asking :).

Leave a Comment