• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

lscpu: command not found

by Deepika

lscpu command gives us information about our processor’s architecture, which operation mode the processor is currently using, the byte order, how many processors we’re running, how many cores, and so on.

In an active Terminal session, type the following command:

$ lscpu

The following screenshot is the result of running lscpu on my 32-bit virtual machine:

lscpu Command Examples in Linux

If you encounter the below error while running the command lscpu:

lscpu: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install util-linux
Ubuntu apt-get install util-linux
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install util-linux
CentOS yum install util-linux
Fedora dnf install util-linux
OS X brew install util-linux
Raspbian apt-get install util-linux

lscpu Command Examples

1. To get the CPU architecture:

# lscpu 

2. To get the lscpu help:

# lscpu -h
# lscpu --help 

3. To find the number of sockets run the following:

# lscpu | grep -i 'socket'

4. To print the output in parsable format:

# lscpu -p
# lscpu --parse 

You can also find similar information in the file /proc/cpuinfo. For example, to find the number of cores run the following command:

# grep "physical id" /proc/cpuinfo | sort | uniq | wc -l

Filed Under: Linux

Some more articles you might also be interested in …

  1. mcookie: command not found
  2. How To Disable Ksplice Service on OEL
  3. Monitor HDD and SSD with smartd and smartctl
  4. Extend volume on non-partitioned disk (XFS) under VMware guest
  5. mate-search-tool: command not found
  6. Creating and Removing Files and Directories Under Linux
  7. RHEL / CentOS : How to rebuild LVM from Archive (metadata backups)
  8. Unable To Boot Up Linux OS with Auditd (CentOS/RHEL)
  9. How to Restrict su Access to a User Only by PAM in Linux
  10. Linux OS Service ‘cups’

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright