NPROC(1)

NAME
nproc - print the number of processors

SYNOPSIS
nproc [--all] [--ignore=count]
nproc --help
nproc --version

DESCRIPTION
The nproc utility is used to print the number of processors limited to the sched_getaffinity(2) mask 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.

BUGS
The Linux port reports discrete CPUs from the current affinity mask and from _SC_NPROCESSORS_ONLN. It does not try to derive fractional processor counts from cgroup CPU quota controllers such as cpu.max.

SEE ALSO
cpuset(1), sched_getaffinity(2)

HISTORY
The nproc utility first appeared in FreeBSD 13.2.

AUTHORS
-nosplit Mateusz Guzik <mjg@FreeBSD.org> wrote the program and Piotr Paweł Stefaniak <pstef@FreeBSD.org> wrote this page.