count the processors

How many processors and cores this machine has, and what they are.

  • system
  • hardware

Steps

  1. nproc

    the processors programs can use

  2. lscpu

    the model, cores, threads and caches

  3. grep -c ^processor /proc/cpuinfo

    the same count, from the kernel

  4. sysctl -n hw.ncpu

    macOS

Commands used

  • nproc
  • lscpu
  • sysctl

Each has a page in lore: lore nproc opens it.