≡ Menu

FreeBSD Display Information About The System Hardware

FreeBSD comes with different utilities, which can be use to gathered the information as per your needs. uname command is use to print system information. dmesg command is use to print kernel ring buffer information. sysctl command is use to configure kernel parameters at runtime as well as to read hardware information.

Following list summaries, all the command you need to gather FreeBSD hardware information.

1) Determining the Hardware Type/platform:
# uname -m
2) Determining machine processor architecture:
# uname -p
3) Determining FreeBSD release level:
# uname -r
Generally, following command is use to get all info at a time:
# uname -mrs

FreeBSD 5.0-RELEASE i386

4) Determining CPU information such as speed, make etc
# dmesg | grep CPU

CPU: Pentium 4 (1716.41-MHz 686-class CPU)
acpi_cpu0:  on acpi0
acpi_cpu: CPU throttling enabled, 8 steps from 100% to 12.5%

5) Determining real and available memory to FreeBSD:
# dmesg | grep memory

real memory  = 201326592 (192 MB)
avail memory = 188555264 (179 MB) 

Alternatively, try following command to grab memory information:
# sysctl -a | grep hw.*mem
# sysctl -a | grep mem


hw.physmem: 194985984
hw.usermem: 167641088
hw.cbb.start_memory: 2281701376

Note systcl has more info, just type the sysctl command to see rest of all information:
# sysctl -a | less
6) Determining how long a system has been up:
# uptime
7) Determining when a system was last rebooted or shutdown:
# last -1 reboot
# last -1 shutdown

8) Determining swap file system usage
# swapinfo -k
9) Determining who is logged in and what they are doing. Following all commands can be used. users command displays the list of all logged in users only.
# w
# who
# users

10) Find out when user was last logged in – You can use last command as follows:
# last user-name
(a) To find out user vivek was last logged, enter:
# last vivek

See FreeBSD getsysinfo.bash script. It is use to find general FreeBSD system information such as, hostname, OS version, Kernel version, Processor/CPU, Total RAM, System load, network interface, total logged in users, Hard disks, Runlevel etc. Make sure your read the detailed installation instruction.

Share this on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 9 comments… add one }
  • Anonymous April 14, 2005, 3:39 am

    Thanks. Needing to branch out from my Linux and Solaris world. . .

  • jamie May 18, 2005, 9:28 am

    Note that the “dmesg” information you are referring to is that retrieved on boot. After a while of system usage, that data can be “lost” as it’s replaced by other information that is appended to the buffer.

    For this reason, the usual startup scripts copy the ‘dmesg’ output on bootup to /var/run/dmesg.boot – you’d be safer grepping your information from that file

  • Nilesh Hiray January 21, 2006, 10:09 pm

    adding to what jamie said …

    a more reliable way to find say the number of CPU’s will be

    cat /var/run/dmesg.boot | grep CPU


  • Anonymous June 22, 2006, 11:10 am

    thanks nilesh.. that was great help

  • Daz May 14, 2008, 7:28 am

    If you only want to know the number of CPUs, try this:

    # sysctl -a | grep hw.ncpu
    hw.ncpu: 8

  • SIFE August 17, 2009, 6:31 pm

    Salamo ALikom
    what i have to type if i want full system hardware like sound card ,video card etc .
    thx for the tutorial .

  • tigos2 September 26, 2009, 11:47 am

    dmesg not work if system has few days and more uptime!
    /var/log/messages* overwrited too!
    I want full report of hardware on the system. How may I do? (ls /dev and pciconf -vl, but is not full report :( )
    May I restart utility like dmesg?

  • Khan November 18, 2009, 3:34 pm

    how to get the mother board model in freebsd

  • Joe April 30, 2010, 1:09 pm

    There’s a utility called dmidecode (available in ports, even), which will provide way more information that you are probably expecting, including motherboard mfg & model. I imagine it’s dependent on the motherboard mfg properly providing this information in whatever data structures this utility queries, but that shouldn’t be any surprise.

    It was able to tell me (on the 2nd & 3rd “Handles”) that I have a Supermicro X7SBi. Quite handy when you want to order the IPMI module for it, and it’s located 45min away.

    http://www.nongnu.org/dmidecode/ for more information.

Leave a Comment

   Tagged with: , , , , , , , , , , , , , , , , , , , , , ,