Language Selection

English French German Italian Portuguese Spanish

Counting processors on your Linux box

Filed under
Linux
HowTos

Ever since the /proc file system first made an appearance on Unix systems, getting information on running processes became a whole lot easier. The useful, but too often insufficient information available in the output of ps commands was thoroughly upstaged by /proc which acts as an interface to kernel data structures. /proc provides interfaces to kernel data structures that can supply information on how memory is being used, what devices are mounted, which file descriptors are in use, and what command line arguments were used with running processes -- and that's just a start. On Linux systems, /proc also contains information on the system's processors. It sits in a file called cpuinfo.

To find out how many processors you have, for example, look through /proc/cpuinfo for lines containing the string "physical id". You can grab this with grep and then pass that information through a couple handy filters like this to get a count:

rest here




More in Tux Machines

Android 4.4 field handheld features 3-inch thermal printer

Two Technologies’s LTE-ready “N5Print” handheld runs Android on a Snapdragon 800 and has a built-in printer plus Smart Card, magstripe, and barcode support. Early smartphones were modeled in part on field-service handhelds, which in turn have increasingly imitated smartphones. This has been especially true in recent years as the product category has migrated from Windows Mobile and CE (and to a lesser extent plain Linux) to Android. In the past, handhelds, which are often available in commercial, as well as similar, but more robust military models, have trailed the current smartphone technology by several years. Yet, we’re seeing and more Android handhelds that rival high end smartphones, such as Arbor’s quad-core, 5.5-inch Gladius 5. Read more

Leftovers: KDE Software

  • PyKDE Future: Seeking a New Maintainer
    For anyone who has been paying any attention of PyKDE5 over the last year or so, it is no secret that development and maintenance has been at a standstill. I've been very busy with a family and small children, and that eats time like you wouldn't believe. (Unit number 2 is almost 6 months now, healthy and happy I can report.) But another important factor is that my interests have shifted towards web related technologies over the last few years.
  • KDE 5_15.03 for Slackware-current
    qt-kde-620x350Here’s the latest and greatest of KDE’s software collection (Frameworks, Plasma, Applications). SInce my last ‘ktown’ release, all of KDE’s sources have been renewed, and today I am making public a package set for KDE 5 aka Plasma 5 with version 5_15.03: my March ’15 release.

OpenELEC 5.0.7 released

The OpenELEC team is proud to announce OpenELEC 5.0.7. OpenELEC-5.0 is the next stable release, which is a feature release and the successor of OpenELEC-4.2. Read more