Home arrow Journal arrow Find home many cores/cpus you have on your FreeBSD machine
Find home many cores/cpus you have on your FreeBSD machine PDF
Saturday, 05 May 2012
If you want to find out how many cores does have your CPU(s) there is a sysctl variable for that. Just run from command line:

  sysctl -a | grep 'hw.ncpu' | cut -d ':' -f2

or:

  sysctl -a | grep 'hw.ncpu' | awk '{print $2}'

This could be useful for example if you want to make a script that will compile world and kernel, to know -j parameter for make, that set the number of threads/cpus used for compilation.

Number of cores can be found also when using top command, just run top and look for C column. Numbering starts from 0 in this case. So if you see 0 and 1 you have two cores. If you see also 2 or 3, then you have 4 cores.

 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?