June 30, 2013

Check CPU and PC Infomation in Ubuntu

There are various ways to find put the system hardware information. I have list below few of them.

1. cat

Another way to get such details is use following command:
$ cat  /proc/cpuinfo

In Ubuntu system information are stored in some system files. To know all this information first you need to know at what file which information is stored. Once you came to know about that then you can get all information using just basic commands.

Cat is such basic command to show the content within file.

Sample Output:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz
stepping : 7
microcode : 0x1b
cpu MHz : 2501.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips : 4988.78
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

As i have Intel i5 processor, its showing repeated same info for all other 3 core. To make this post short I had eliminated that. When you try on your system you will find whole output.

2. Dmidecode

dmidecode  is a tool for dumping a computer's DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description  of  the  system's  hardware  components,  as well as other useful pieces of information such as serial numbers and BIOS revision.  Thanks to  this  table,  you  can  retrieve this information without having to probe for the actual hardware.  While this is a good point in terms  of report  speed  and  safeness, this also makes the presented information possibly unreliable.

As you run it, dmidecode will try to locate the DMI table. If  it  succeeds, it will then parse this table and display a list of records like this one:

Handle 0x0002, DMI type 2, 8 bytes.  Base Board Information
Manufacturer: Intel
Product Name: C440GX+
Version: 727281-001
Serial Number: INCY92700942

Type   Information
          0   BIOS
          1   System
          2   Base Board
          3   Chassis
          4   Processor
          5   Memory Controller
          6   Memory Module
          7   Cache
          8   Port Connector
          9   System Slots
         10   On Board Devices
         11   OEM Strings
         12   System Configuration Options
         13   BIOS Language
         14   Group Associations
         15   System Event Log
         16   Physical Memory Array
         17   Memory Device
         18   32-bit Memory Error
         19   Memory Array Mapped Address
         20   Memory Device Mapped Address
         21   Built-in Pointing Device
         22   Portable Battery
         23   System Reset
         24   Hardware Security
         25   System Power Controls
         26   Voltage Probe
         27   Cooling Device
         28   Temperature Probe
         29   Electrical Current Probe
         30   Out-of-band Remote Access
         31   Boot Integrity Services
         32   System Boot
         33   64-bit Memory Error
         34   Management Device
         35   Management Device Component
         36   Management Device Threshold Data
         37   Memory Channel
         38   IPMI Device
         39   Power Supply
         40   Additional Information
         41   Onboard Device

You can use this type to get particular information.

Example: If I need to get information about BIOS only then I will use 
sudo dmidecode  --type 1
To get information about BIOS Language use
sudo dmidecode --type 13
To get both BIOS and BIOS Language use
sudo dmidecode -- type 1 --type 13

To have information about particular component use respective type number.

3. ls*

Simply using ls will show you list of files and directory.

lscpu  gathers  CPU  architecture  information  like  number  of  CPUs, threads, cores, sockets, NUMA nodes, information about CPU caches,  CPU family,  model,  bogoMIPS,  byte  order  and  stepping  from  sysfs and /proc/cpuinfo, and prints it in a human-readable format.   It  supports both online and offline CPUs.

lspci  is  a  utility for displaying information about PCI buses in the system and devices connected to them.

lsmod  is  a  trivial  program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded.

lsusb  is  a  utility for displaying information about USB buses in the system and the devices connected to them.

lsof  lists on its standard output file information about files opened by processes.

lshw  is  a  small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc.

lsblk  lists information about all or the specified block devices.  The lsblk command reads the sysfs filesystem to gather information.

No comments:

Post a Comment