Freebsd查看硬件信息

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

sysctl hw.model hw.ncpu
dmesg | grep "CPU:"
查询CPU核心数：
sysctl -a |grep ncpu
或者：
cat /var/run/dmesg.boot |grep Dete
再或者
sysctl hw.ncpu

Harddisk：
df -h
cat /var/run/dmesg.boot | grep da0
fdisk /dev/da0 |grep size


Menory info：
查询方法一：
cat /var/run/dmesg.boot | grep memory
usable memory = 25755664384 (24562 MB)
avail memory  = 24964411392 (23807 MB)
dmesg | grep "real memory" | awk -F '[( )]' '{print $2,$4,$7,$8}'
dmidecode -t memory|grep Size

查询方法二：
sysctl -a | grep hw.physmem
hw.physmem: 25755664384

cat /var/run/dmesg.boot |grep Dete
cat /var/run/dmesg.boot | grep da0
cat /var/run/dmesg.boot | grep memory

SWAP
top | grep "Swap:" | awk '{print $1,$2}'