Scroll to navigation

nproc(1) General Commands Manual nproc(1)

NAME

nproc - Print the number of cores available to the current process. If the OMP_NUM_THREADS or OMP_THREAD_LIMIT environment variables are set, then they will determine the minimum and maximum returned value respectively.

SYNOPSIS

nproc [--all] [--ignore] [-h|--help] [-V|--version]

DESCRIPTION

Print the number of cores available to the current process. If the OMP_NUM_THREADS or OMP_THREAD_LIMIT environment variables are set, then they will determine the minimum and maximum returned value respectively.

OPTIONS

print the number of cores available to the system
ignore up to N cores
Print help
Print version

VERSION

v(uutils coreutils) 0.7.0

EXAMPLES

Display the number of available processing units:

nproc

Display the number of installed processing units, including any inactive ones:

nproc --all

If possible, subtract a given number of units from the returned value:

nproc --ignore count

The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.

nproc (uutils coreutils) 0.7.0