Published: 04 Mar 2018 › Updated: 04 Mar 2018
CPUs
Ever needed to check really quick how many CPUs your *nix machine is running? Maybe you're logged into a remote server, or maybe you just forgot. In any case, I keep finding myself in a such situations and have had to look this up more than once.
Quickie
Here's a couple ways to go about it. On Linux boxes you can run:
> grep -c processor /proc/cpuinfo
=> 4
Or opt for the less verbose:
> nproc
=> 4
On MacOS:
> sysctl -n hw.physicalcpu
=> 8
ʘ‿ʘ
Leave CPUs to:
Read more #linux posts
Best Posts From davidpm
We have not curated any of davidpm's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From davidpm
- Disabling dangerous redis commands in Production redux
- Heuristics on the Practice of Programming
- Git Interactive Rebase to Alter Commits
- Dropping Into B-trees
- Create a command-line gem from scratch with Thor (part two)
- Create a command-line gem from scratch with Thor
- Blockchain Proof of Concept
- SQL Cheat Sheet
- Bootstrap with Rails and Postgres
- REGEX Multiline Anchors
- Rspec Config
- Rails MIME Types
- Messages with Methods in Ruby
- CPUs