One more way to count CPUs in Linux

Here is one more way to find out how many CPUs are used by Linux:
cat /proc/cpuinfo | grep “^vendor_id” | wc -l

As for me I use this way to make sure that SMP kernel should be installed.

You’re welcome to suggest your ways of doing the same in comments. Thank you in advance!

 
 
» You might also be interested in the following articles:
Set up mount count after system will be checked by e2fsck
Manage gzip files on-the-fly (zcommands)
FAQ: How to retreive hardware manufacturer name, serial numbers, etc. in Linux command line
htop: new generation Linux processes viewer
Web server popularity 2007 (October)



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!

2 Responses to “One more way to count CPUs in Linux”


  1. 1 polarizer

    While browsing your blog i found this one liner here with two pipes where not a single one is needed

    grep -c ^vendor_id /proc/cpuinfo

    Do you know the “useless use of cat” award[1] :O)

    Nevertheless. Really useful resources here.

    The polarizer

    http://partmaps.org/era/unix/award.html

  2. 2 artiomix

    Hi Polarizer!

    Thanks for the tip, it’s appreciated!

Leave a Reply




Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | Linux config Wiki | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››