nproc
Print the number of processing units (normally CPUs) available. More information: <https://www.gnu.org/software/coreutils/nproc>.
Install
- All systems
-
curl cmd.cat/nproc.sh
- Debian
-
apt-get install coreutils - Ubuntu
-
apt-get install coreutils -
Alpine
-
apk add coreutils - Arch Linux
-
pacman -S coreutils - Kali Linux
-
apt-get install coreutils - CentOS
-
yum install coreutils - Fedora
-
dnf install coreutils - Windows (WSL2)
-
sudo apt-get updatesudo apt-get install coreutils - OS X
-
brew install coreutils - Raspbian
-
apt-get install coreutils - Docker
-
docker run cmd.cat/nproc nprocpowered by Commando
Print the number of processing units (normally CPUs) available. More information: <https://www.gnu.org/software/coreutils/nproc>.
-
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
© tl;dr; authors and contributors