NPROC(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

🌸 NPROC β€” okay bestie, let's count your CPUs πŸ’…

No seriously, that's the whole manual name: nproc, and it prints the number of processing units available. It's the nproc(1) page from the User Commands section. That's it. That's the girl. πŸ‘‘


✨ SYNOPSIS ✨

nproc [OPTION]...

Just nproc and then whatever options you feel like. She's flexible like that. πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea β˜•: nproc prints the number of processing units available to the current process. Not the whole machine β€” to your process. Which means, lowkey, that number may be less than the number of online processors. It's giving "you don't get the whole cake, you get your slice." 🍰

And here's the plot twist that gets people every time: if the OMP_NUM_THREADS or OMP_THREAD_LIMIT environment variables are set, they will determine the minimum and maximum returned value respectively. So OMP_NUM_THREADS sets your floor, OMP_THREAD_LIMIT sets your ceiling. The env vars are literally the parents here, and they're setting a curfew. πŸ™ˆ

Now the options, bestie, one by one, no skipping: ✨

  • --all β€” prints the number of installed processors, and it does it while disregarding any OpenMP environment variables, or CPU quotas. She said "I don't know her" to the limits. πŸ”₯
  • --ignore=N β€” if possible, excludes N processing units. And the result is guaranteed to be at least 1, so she'll never hand you a zero, she's not gonna do you like that. 🫢
  • --help β€” displays this help and exits. Classic. πŸ’–
  • --version β€” outputs version information and exits. Also classic. ✨

πŸŽ€ AUTHOR πŸŽ€

Written by Giuseppe Scrivano. We stan. πŸ‘‘


πŸ’Œ REPORTING BUGS πŸ’Œ

Found a bug? Don't be shy, tell the coreutils girlies:


🌈 SEE ALSO 🌈

And for the legal-lore girlies, because we keep every single receipt: 🧾

  • Packaged by Ubuntu (9.10-1ubuntu2)
  • Copyright Β© 2026 Free Software Foundation, Inc.
  • License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
  • This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Not a vibe, but like, legally important. πŸ’€

GNU coreutils 9.10, August 2026, and this whole page is NPROC(1) β€” mwah, that's the wrap, go count some CPUs bestie, ily, bye! πŸ’–βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from