commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
All Linux Systems I try also have an empty line per cpu in /proc/cpuinfo... little shorter then...
There are 6 alternatives - vote for the best!
/proc/cpuinfo contains information about the CPU.
Search for "processor" in the /proc/cpuinfo file
wc -l, counts the number of lines.
this works for a Linux based system, other UNIX systems may have other way(s) to check the number of CPUs.
If you can do better, submit your command here.
You must be signed in to comment.