• 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 Examples in Linux

by admin

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

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. less: command not found
  2. conky: command not found
  3. How to Enable Remote Desktop to Share the Current Desktop Session in CentOS/RHEL 7
  4. Linux OS Service ‘named’
  5. How to create and mount filesystems in Linux
  6. homectl Command Examples in Linux
  7. How to Manage Oracle database Audit File Directory Growth with cron (ASM Instances Only)
  8. lvm: command not found
  9. pstree Command Examples in Linux
  10. How to change the default permissions on /var/log/audit/audit.log file in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright