×

Search anything:

Check Computer specs in Linux

Binary Tree book by OpenGenus

Open-Source Internship opportunity by OpenGenus for programmers. Apply now.

In this article, we will cover the commands to take a note of your System configuration (computer specs / specification). Noting the specifications of a system is a demanded skills and a strongly followed practice as it impacts the performance. Infact, all industry benchmarks are associated with a specific system configuration.

You can follow along to create a list of your system configuration / Computer specs / specifications.

lscpu

lscpu command will information about the CPU architecture by reading sysfs and /proc/cpuinfo files. The output is human readable and hence, is the first step of system configuration information.

Command:

lscpu

Output:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                112
On-line CPU(s) list:   0-111
Thread(s) per core:    2
Core(s) per socket:    28
Socket(s):             2
NUMA node(s):          4
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Platinum 8180 CPU @ 2.50GHz
Stepping:              4
CPU MHz:               2494.256
BogoMIPS:              4988.51
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              1024K
L3 cache:              39424K
NUMA node0 CPU(s):     0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108
NUMA node1 CPU(s):     1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101,105,109
NUMA node2 CPU(s):     2,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110
NUMA node3 CPU(s):     3,7,11,15,19,23,27,31,35,39,43,47,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111
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 pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch ida arat epb invpcid_single pln pts dtherm intel_pt kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc pku ospke

Let us break down the information to bring out what we want to see:

  • It has 2 sockets with 28 cores per socket and 2 threads per socket
  • As 2 * 28 * 2 = 112 is same as number of CPUs, hyperthreading is off. If hyperthreading is one, then number of threads should be double of number of CPUs.
  • There are 4 NUMA nodes
  • CPU frequency: 2494.256 MHz
  • Model name: Intel(R) Xeon(R) Platinum 8180 CPU @ 2.50GHz

You can note all details to be super specific as per your requirements.

uname -a

This command will provide the kernel name.

Command:

uname -a

Output:

Linux linux-mzys 4.4.162-94.72-default #1 
SMP Mon Nov 12 18:57:45 UTC 2018 (9de753f) 
x86_64 x86_64 x86_64 GNU/Linux

sudo dmidecode

The first information we need is the clock speed. We can grep MT the output of sudo dmidecode to get this information conveniently.

sudo dmidecode | grep MT

Output:

MTRR (Memory type range registers)
        Speed: 2133 MT/s
        Configured Clock Speed: 1067 MT/s

In this command, we will get the Physical memory slot using grep DDR

sudo dmidecode | grep DDR

Output:

Type: DDR4

To get the memory rank, grep Rank as follows:

sudo dmidecode | grep Rank

Output:

Rank: 2

To get the clock frequency, use the following command:

sudo dmidecode | grep MHz

Output:

External Clock: 100 MHz
Max Speed: 4200 MHz
Current Speed: 3400 MHz

To get the DIMM information, get the following command:

sudo dmidecode | grep DIMM

Output:

Form Factor: DIMM
Locator: DIMM 0
Form Factor: DIMM
Locator: DIMM 1

To get the system memory:

sudo dmidecode | grep GB

Output:

Maximum Capacity: 512 GB
Range Size: 128 GB
Range Size: 128 GB
Range Size: 128 GB
Range Size: 128 GB

cat /proc/meminfo

Get memory statistics of your system using this command:

cat /proc/meminfo

Output:

MemTotal:       394877600 kB
MemFree:        322057928 kB
MemAvailable:   391704744 kB
Buffers:         2735168 kB
Cached:         66592340 kB
SwapCached:        39408 kB
Active:         44374924 kB
Inactive:       25087292 kB
Active(anon):      89332 kB
Inactive(anon):    94996 kB
Active(file):   44285592 kB
Inactive(file): 24992296 kB
Unevictable:          80 kB
Mlocked:              80 kB
SwapTotal:      16779260 kB
SwapFree:       12971548 kB
Dirty:                 0 kB
Writeback:             4 kB
AnonPages:         98584 kB
Mapped:            73280 kB
Shmem:             49620 kB
Slab:            2853688 kB
SReclaimable:    2744528 kB
SUnreclaim:       109160 kB
KernelStack:       20608 kB
PageTables:         7668 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    214218060 kB
Committed_AS:    4248960 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:     32768 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      669504 kB
DirectMap2M:    50388992 kB
DirectMap1G:    352321536 kB

It gives all memory associated details and you may keep only those that is needed as per your application.

gcc --version

This command is used to get the operating system version.

gcc --version

Output:

gcc (SUSE Linux) 6.2.1 20160826 [gcc-6-branch revision 239773]
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So, the operating system detected is: SUSE Linux 6.2.1 20160826

lsb_release -a

An alternative command to get details of your operating system is lsb_release -a

Command:

lsb_release -a

Output:

LSB Version:    n/a
Distributor ID: SUSE
Description:    openSUSE 12.3 (Dartmouth) (x86_64)
Release:        12.3
Codename:       n/a

With this article at OpenGenus, you must have the complete idea of how to Check Computer specs in Linux.

OpenGenus Tech Review Team

OpenGenus Tech Review Team

The official account of OpenGenus's Technical Review Team. This team review all technical articles and incorporates peer feedback. The team consist of experts in the leading domains of Computing.

Read More

Improved & Reviewed by:


Check Computer specs in Linux
Share this