lscpu Linux Command Guide
The lscpu command in Linux provides detailed information about the CPU architecture, processing units, sockets, cores per socket, threads per core, and more. It helps users understand the configuration of their CPU and how it is utilized by the system. By running lscpu, you can quickly access essential details about your CPU, such as its model name, vendor, CPU family, cache sizes, and processor flags. This command is useful for system administrators, developers, and users who need to optimize system performance, troubleshoot issues, or gather information about the CPU for various purposes.
lscpu Syntax:
Options:
Option | Description |
---|---|
-a | Display all information |
-p | Show all available information |
-e | Show extended information |
-s | Show short output |
-x | Show additional details |
-y | Show information in YAML format |
-c | Show information in CSV format |
Parameters:
Parameter | Description |
---|---|
None | It does not have any specific parameter. |
lscpu Command Samples:
Display CPU Information
Displays detailed information about the CPU.
Display Only the Architecture
Displays only the architecture information of the CPU.
Display CPU Core Information
Displays the number of CPU cores per socket.
Display CPU Thread Information
Displays the number of threads per CPU core.
Display CPU Clock Speed
Displays the CPU clock speed in MHz.
Display CPU Socket Information
Displays the number of CPU sockets.
Display CPU Vendor Information
Displays the CPU vendor information.
How do I display CPU architecture information using lscpu?
To display CPU architecture information using lscpu, run the following command:
How to show just the CPU model name with lscpu?
To show just the CPU model name with lscpu, use the following command:
Can lscpu show the number of physical CPU sockets?
Yes, to display the number of physical CPU sockets using lscpu, use the command:
How to get information about CPU cores and threads with lscpu?
To get information about CPU cores and threads with lscpu, execute the command:
What is the command to display CPU cache information using lscpu?
To display CPU cache information using lscpu, use the following command:
Can lscpu provide details about CPU flags?
Yes, you can use lscpu to get details about CPU flags by running the command:
Applications of the lscpu command
- Determine the number of CPUs on the system
- View information about the CPU architecture
- Display CPU vendor information
- Show CPU family, model, and stepping
- Check CPU frequency and max/min frequencies
- View CPU cache information
- Display NUMA (Non-Uniform Memory Access) information
- Show flags indicating CPU features
- Determine the endianness of the CPU
- Check the number of threads per core and cores per socket