nproc(1)

nproc1

Print the number of processors

Usage

nproc [--all] [--ignore=count]

nproc --help

nproc --version

Overview

The nproc utility is used to print the number of processors limited to the cpuset(2) of the current process, unless the --all flag is specified.

The available flags are:

--all

Count all processors currently online.

--ignore=count

The result is decreased by count, but never below 1.

--version

Print the current program version and exit. Do not use this option.

--help

Print usage information and exit.

Compatibility

This program is intended to be compatible with nproc as found in GNU coreutils.

Releases

13 releases since FreeBSD 13.2-RELEASE; the text changed 2 times.

  1. 13.2
  2. 13.3–13.5
  3. 14.0–16.0

Bugs

If HyperThreading is enabled in BIOS and disabled in the kernel, the --all option on Linux will still report all possible CPU threads. On FreeBSD only active threads will be reported.

History

The nproc utility first appeared in FreeBSD 13.2.

Authors

Mateusz Guzik ⟨[email protected]⟩ wrote the program and Piotr Paweł Stefaniak ⟨[email protected]⟩ wrote this page.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.