You are hereFind basic system specification information in Linux

Find basic system specification information in Linux


By charm - Posted on 15 December 2009

One of the things we do a lot of in Computer Recycling is find the specifications for a donated machine. Typically we go into the BIOS or look at the hardware, but sometimes there's a need to find system information from within a booted Linux system. Since the command line is pretty much universal the following command should work on just about any Linux system:

cat /proc/cpuinfo | grep 'model name' > sysinfo.txt | cat /proc/meminfo | grep MemTotal >> sysinfo.txt | df -hH >> sysinfo.txt

I put this 1 line command, which is actually 4 commands strung together in a file I called findinfo. Then I run chmod ug+x findinfo. What this does is make findinfo executable. It can then be run from the directory it's in by typing: ./findinfo

Of course you can just run the long string of commands as they are above, but it's a little hard to remember.

What this string of commands does is create a file called sysinfo.txt which contains the CPU information (if like the screen shot you see 2 CPUs listed it means your system is either hyperthreaded or dual core), the amount of memory, and the hard drive space and partitioning (in marketing specs 1000kb vs 1024kb). Sysinfo.txt can be read with any text editor or you can just run: less sysinfo.txt

Tags

Another handy tool for getting information about the memory in a system:

# dmidecode -t memory

This produces quite a bit of information about the memory in a system, including the type and speed. I find the accuracy varies with different systems. The 'Type' reported by this program is not always accurate, but the 'Speed' usually helps you figure out the correct type. The program reported a system with PC2100 DDR memory as having Type 'SDRAM' and Speed '266 MHz'. My laptop with PC5300 DDR2 memory is reported as having Type 'DDR' and Speed '667 MHz'.

You'll need to run this program as root, or use sudo.

Thanks Mike, this is good advice. In Ubuntu you'd have to run:

sudo dmidecode -t memory

Or you could sudo -i (to change to root) and then run it from the root prompt.

Who's new

  • 89
  • 39
  • 85
  • leilaH
  • biggerbri