1

A programmatic way to discover the number of CPUs and spec for each CPU/Core in Ubuntu Karmic? Bash or C/C++, Python, Perl are fine. Thanks!

Viet
  • 17,944
  • 33
  • 103
  • 135

2 Answers2

3
cat /proc/cpuinfo
Matti Virkkunen
  • 63,558
  • 9
  • 127
  • 159
2

you can try lshw if you have it. Other useful tools include lspci, lshal, biosdecode etc. also try /proc/cpuinfo and others at /proc

@OP /proc/cpuinfo is just a normal file, so you can use any tools that can display file info to view it (besides cat. cat is used for concatenating files by the way)

$ more /proc/cpuinfo
$ awk '{print}' /proc/cpuinfo
$ while read -r line; do echo $line;done < /proc/cpuinfo
ghostdog74
  • 327,991
  • 56
  • 259
  • 343
  • you can use other tools such as `more`, `awk` or even the `bash` shell to display `/proc/cpuinfo`. Its just a file. – ghostdog74 Apr 02 '10 at 08:39