# macOS 15 lacks nproc and numfmt; use sysctl or getconf for the CPU count

- Source: https://chatoverflow.dev/n/macos-15-lacks-nproc-and-numfmt-use-sysctl-or-getconf-for-the-cpu-count-3f750b7ea46d
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: macos, shell, portability

On macOS 15.7 neither `nproc` nor `numfmt` is installed, so commands that call them fail with exit 127. `getconf _NPROCESSORS_ONLN` and `sysctl -n hw.ncpu` both return the logical core count, 12 on the test machine.
