Which of the following Linux commands is used to determine the type of processor?

By Alvin Alexander. Last updated: September 10, 2022

Linux FAQ: How can I find Linux processor and memory information? (Also written as, How can I find Linux CPU information?, How can I find Linux RAM information?)

How to show the Linux CPU/processor

To see what type of processor/CPU your computer system has, use this Linux command:

cat /proc/cpuinfo

As you can see, all you have to do is use the Linux cat command on this special /proc/cpuinfo file on your Linux system. (See below for sample processor output.)

How to show Linux memory information

To see your Linux memory information and memory stats use this command:

cat /proc/meminfo

(See below for sample output.)

Linux processor command output

When I issue that Linux processor information command on my current hardware system, I see this output:

# cat /proc/cpuinfo

processor	: 0
vendor_id	: GenuineIntel
cpu family	: 15
model		: 4
model name	: Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping	: 1
cpu MHz		: 3007.103
cache size	: 1024 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 1
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe constant_tsc pni monitor ds_cpl cid xtpr
bogomips	: 6016.05

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 15
model		: 4
model name	: Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping	: 1
cpu MHz		: 3007.103
cache size	: 1024 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 1
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe constant_tsc pni monitor ds_cpl cid xtpr
bogomips	: 6012.84

From that output I can see my current system is a two-processor Intel system, with additional information about the Intel CPU (CPUs, actually).

Linux memory information command

When I issue the Linux memory information command, I see the following output:

# cat /proc/meminfo

MemTotal:      2067508 kB
MemFree:         92788 kB
Buffers:        246168 kB
Cached:        1362296 kB
SwapCached:          0 kB
Active:        1073132 kB
Inactive:       637304 kB
HighTotal:     1171392 kB
HighFree:         7228 kB
LowTotal:       896116 kB
LowFree:         85560 kB
SwapTotal:     2096472 kB
SwapFree:      2096352 kB
Dirty:            6584 kB
Writeback:           0 kB
AnonPages:      101832 kB
Mapped:          20440 kB
Slab:           255360 kB
PageTables:       1760 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   3130224 kB
Committed_AS:   306204 kB
VmallocTotal:   114680 kB
VmallocUsed:      3708 kB
VmallocChunk:   110860 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     4096 kB

As you can see, my current Linux system has 2 GB RAM, with all the additional memory information shown there.

Summary: Linux processor and memory commands

I hope these Linux processor and memory commands have been helpful. When you have some spare time, take a look at the /proc filesystem on your Linux system for other system information you can find, including /proc/loadavg, /proc/vmstat, and much more.

There are many reasons you might need to find out details about your computer hardware. For example, if you need help fixing something and post a plea in an online forum, people will immediately ask you for specifics about your computer. Or, if you want to upgrade your computer, you'll need to know what you have and what you can have. You need to interrogate your computer to discover its specifications.

The easiest way is to do that is with one of the standard Linux GUI programs:

  • i-nex collects hardware information and displays it in a manner similar to the popular CPU-Z under Windows.
  • HardInfo displays hardware specifics and even includes a set of eight popular benchmark programs you can run to gauge your system's performance.
  • KInfoCenter and Lshw also display hardware details and are available in many software repositories.

Alternatively, you could open up the box and read the labels on the disks, memory, and other devices. Or you could enter the boot-time panels—the so-called UEFI or BIOS panels. Just hit the proper program function key during the boot process to access them. These two methods give you hardware details but omit software information.

Or, you could issue a Linux line command. Wait a minute… that sounds difficult. Why would you do this?

Sometimes it's easy to find a specific bit of information through a well-targeted line command. Perhaps you don't have a GUI program available or don't want to install one.

Probably the main reason to use line commands is for writing scripts. Whether you employ the Linux shell or another programming language, scripting typically requires coding line commands.

Many line commands for detecting hardware must be issued under root authority. So either switch to the root user ID, or issue the command under your regular user ID preceded by sudo:

sudo <the_line_command>

and respond to the prompt for the root password.

This article introduces many of the most useful line commands for system discovery. The quick reference chart at the end summarizes them.

Hardware overview

There are several line commands that will give you a comprehensive overview of your computer's hardware.

The inxi command lists details about your system, CPU, graphics, audio, networking, drives, partitions, sensors, and more. Forum participants often ask for its output when they're trying to help others solve problems. It's a standard diagnostic for problem-solving:

inxi -Fxz

The -F flag means you'll get full output, x adds details, and z masks out personally identifying information like MAC and IP addresses.

The hwinfo and lshw commands display much of the same information in different formats:

hwinfo --short

or

lshw -short

The long forms of these two commands spew out exhaustive—but hard to read—output:

hwinfo

or

lshw

CPU details

You can learn everything about your CPU through line commands. View CPU details by issuing either the lscpu command or its close relative lshw:

lscpu

or

lshw -C cpu

In both cases, the last few lines of output list all the CPU's capabilities. Here you can find out whether your processor supports specific features.

With all these commands, you can reduce verbiage and narrow any answer down to a single detail by parsing the command output with the grep command. For example, to view only the CPU make and model:

lshw -C cpu | grep -i product

To view just the CPU's speed in megahertz:

lscpu | grep -i mhz

or its BogoMips power rating:

lscpu | grep -i bogo

The -i flag on the grep command simply ensures your search ignores whether the output it searches is upper or lower case.

Memory

Linux line commands enable you to gather all possible details about your computer's memory. You can even determine whether you can add extra memory to the computer without opening up the box.

To list each memory stick and its capacity, issue the dmidecode command:

dmidecode -t memory | grep -i size

For more specifics on system memory, including type, size, speed, and voltage of each RAM stick, try:

lshw -short -C memory

One thing you'll surely want to know is is the maximum memory you can install on your computer:

dmidecode -t memory | grep -i max

Now find out whether there are any open slots to insert additional memory sticks. You can do this without opening your computer by issuing this command:

lshw -short -C memory | grep -i empty

A null response means all the memory slots are already in use.

Determining how much video memory you have requires a pair of commands. First, list all devices with the lspci command and limit the output displayed to the video device you're interested in:

lspci | grep -i vga

The output line that identifies the video controller will typically look something like this:

00:02.0 VGA compatible controller: Intel Corporation 82Q35 Express Integrated Graphics Controller (rev 02)

Now reissue the lspci command, referencing the video device number as the selected device:

lspci -v -s 00:02.0

The output line identified as prefetchable is the amount of video RAM on your system:

...
Memory at f0100000 (32-bit, non-prefetchable) [size=512K]
I/O ports at 1230 [size=8]
Memory at e0000000 (32-bit, prefetchable) [size=256M]
Memory at f0000000 (32-bit, non-prefetchable) [size=1M]
...

Finally, to show current memory use in megabytes, issue:

free -m

This tells how much memory is free, how much is in use, the size of the swap area, and whether it's being used. For example, the output might look like this:

total        used        free     shared    buff/cache   available
Mem:          11891        1326        8877      212        1687       10077
Swap:          1999           0        1999

The top command gives you more detail on memory use. It shows current overall memory and CPU use and also breaks it down by process ID, user ID, and the commands being run. It displays full-screen text output:

top

Disks, filesystems, and devices

You can easily determine whatever you wish to know about disks, partitions, filesystems, and other devices.

To display a single line describing each disk device:

lshw -short -C disk

Get details on any specific SATA disk, such as its model and serial numbers, supported modes, sector count, and more with:

hdparm -i /dev/sda

Of course, you should replace sda with sdb or another device mnemonic if necessary.

To list all disks with all their defined partitions, along with the size of each, issue:

lsblk

For more detail, including the number of sectors, size, filesystem ID and type, and partition starting and ending sectors:

fdisk -l

To start up Linux, you need to identify mountable partitions to the GRUB bootloader. You can find this information with the blkid command. It lists each partition's unique identifier (UUID) and its filesystem type (e.g., ext3 or ext4):

blkid

To list the mounted filesystems, their mount points, and the space used and available for each (in megabytes):

df -m

Finally, you can list details for all USB and PCI buses and devices with these commands:

lsusb

or

lspci

Network

Linux offers tons of networking line commands. Here are just a few.

To see hardware details about your network card, issue:

lshw -C network

Traditionally, the command to show network interfaces was ifconfig:

ifconfig -a

But many people now use:

ip link show

or

netstat -i

In reading the output, it helps to know common network abbreviations:

AbbreviationMeaning
lo Loopback interface
eth0 or enp* Ethernet interface
wlan0 Wireless interface
ppp0 Point-to-Point Protocol interface (used by a dial-up modem, PPTP VPN connection, or USB modem)
vboxnet0 or vmnet* Virtual machine interface

The asterisks in this table are wildcard characters, serving as a placeholder for whatever series of characters appear from system to system.

To show your default gateway and routing tables, issue either of these commands:

ip route | column -t

or

netstat -r

Software

Let's conclude with two commands that display low-level software details. For example, what if you want to know whether you have the latest firmware installed? This command shows the UEFI or BIOS date and version:

dmidecode -t bios

What is the kernel version, and is it 64-bit? And what is the network hostname? To find out, issue:

uname -a

Quick reference chart

This chart summarizes all the commands covered in this article:

Display info about all hardware inxi -Fxz              --or--

hwinfo --short     --or--

lshw  -short

Display all CPU info lscpu                  --or--

lshw -C cpu

Show CPU features (e.g., PAE, SSE2) lshw -C cpu | grep -i capabilities
Report whether the CPU is 32- or 64-bit lshw -C cpu | grep -i width
Show current memory size and configuration dmidecode -t memory | grep -i size    --or--

lshw -short -C memory

Show maximum memory for the hardware dmidecode -t memory | grep -i max
Determine whether memory slots are available lshw -short -C memory | grep -i empty

(a null answer means no slots available)

Determine the amount of video memory lspci | grep -i vga

then reissue with the device number;

for example:  lspci -v -s 00:02.0

The VRAM is the prefetchable value.

Show current memory use free -m    --or--

top

List the disk drives lshw -short -C disk
Show detailed information about a specific disk drive hdparm -i /dev/sda

(replace sda if necessary)

List information about disks and partitions lsblk      (simple)      --or--

fdisk -l   (detailed)

List partition IDs (UUIDs) blkid
List mounted filesystems, their mount points,

and megabytes used and available for each

df -m
List USB devices lsusb
List PCI devices lspci
Show network card details lshw -C network
Show network interfaces ifconfig -a       --or--

ip link show   --or--

netstat -i

Display routing tables ip route | column -t  --or--

netstat -r

Display UEFI/BIOS info dmidecode -t bios
Show kernel version, network hostname, more uname -a

Do you have a favorite command that I overlooked? Please add a comment and share it.

Which of the following Linux commands is used to determine the type of processor?
This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.

Which command is used to check CPU usage in Linux?

The mpstat command provides information about CPU performance and utilization by giving CPU statistics for the whole system and each available processor. Running the mpstat command on a Linux system will display an output like the one shown in figure 2.

Is there some Linux command that can fetch us the CPU info directly?

cpuid Command – Shows x86 CPU The command cpuid dumps complete information about the CPU(s) collected from the CPUID instruction, and also discover the exact model of x86 CPU(s) from that information. Make sure to install it before running it. Once installed, run cpuid to collect information concerning the x86 CPU.

Which of the following commands display information about the CPU that your Linux system is running on?

To view information about your CPU, use the lscpu command as it shows information about your CPU architecture such as a number of CPUs, cores, CPU family model, CPU caches, threads, etc from sysfs and /proc/cpuinfo.

What is Linux Lscpu command?

The command-line utility “lscpu” in Linux is used to get CPU information of the system. The “lscpu” command fetches the CPU architecture information from the “sysfs” and /proc/cpuinfo files and displays it in a terminal.