Here, in this example, there are 4 cores processor so it will show list of all cores from 0 to 3. If you have any suggestion or question, just drop a comment, also don't forget to share this tutorial if you find it useful.It will show the logical CPU with identification number. I hope this tutorial is informative and easy to understand. So, that 's it, how you could find CPU info in Linux, strip down the commands according to your need while using within a shell script. A great visual representation of the CPU information and how some devices are connected through the PCI-E bus. Run hwloc-ls or lstopo, this will open up a GUI window, displaying a nice image like bellow. Now the hwloc, install it with apt-get in any Debian based distro, sudo apt-get install hwloc The HardInfo interface is quite easy to understand, explore through different options to discover more. You could run it from a terminal emulator by running the hardinfo command,or open up from the menu, usually named as System Profiler and Benchmark. Here's how to install Hardinfo in any Debian based distro with apt-get. There are lots of them, KInfocenter, HardInfo, cpu-g, hwloc and so on, I'm going to discus about Hardinfo and hwloc. Read more about microcode, how to update CPU microcode in Linux. To check CPU microcode version use, grep -i microcode /proc/cpuinfo | uniqĪn alternative method could be with dmesg dmesg | grep -i microcodr Check CPU microcode versionĬPU microcode could be called the firmware of the CPU, to enhance it's usability and add new features. The hwloc -ls command displays the CPU cache memory in a nice picture, it's a GUI app, more about hwloc-ls bellow. lscpu | grep 'cache'Īnother method could be grep -i 'cache size' /proc/cpuinfo | uniq You can use the lscpu command to find available L1, L2 and 元 cache memory. You can use the CoreFreq application on Linux to check CPU usage and more. lscpu | grep -iE 'CPU MHz|CPU max MHz|CPU min MHz' CPU MHz: 800.328 To check the current frequency and maximum/minimum frequency supported by the CPU use the lscpu command. To find out current CPU frequency, use the /proc/cmdline file to get per thread frequency, grep -i mhz /proc/cpuinfo lscpu | grep -iE 'Architecture:|CPU op-mode(s):|Byte Order:' Architecture: x86_64įind current, maximum and minimum CPU frequency To know your CPU architecture, it supports 64 bit OS or not, and CPU endianness, use the lscpu command. You may create an alias or use it directly like bellow make -j $(grep -c "^processor" /proc/cpuinfo) Find CPU architecture, CPU endianness and supported operation modes Or use the grep command like bellow grep -c "^processor" /proc/cpuinfo While building some software form source in Linux with make, you probably use the -j flag for faster parallel compilation, you could automatically assign number of CPUs with this command,Įnjoy free shipping and One-Day delivery, cancel any time. You can easily observe the hyper threading capability of the CPU from the threads per core count, here it's 2 threads per core. If you are not familiar with what is NUMA, read this NUMA wiki article. You need to append each brackets with one backslash for proper functioning of grep command. lscpu | grep -iE 'Thread(s) per core:|Core(s) per socket:|Socket(s):|NUMA node(s):' Thread(s) per core: 2 All grep filtering parameters are merged into one, use only whatever you need. You can use any method mentioned above to find out this, I'm using the lscpu command here. Version: Intel(R) Core(TM) i5-2410M CPU 2.30GHzįind number of CPU socket, cores, threads and NUMA nodes Sudo dmidecode -t 4 | grep -i 'Manufacturer:|Version:' Manufacturer: Intel(R) Corporation Model name : Intel(R) Core(TM) i5-2410M CPU 2.30GHz Vendor_id : GenuineIntel grep -i 'model name' /proc/cpuinfo | uniq Model name: Intel(R) Core(TM) i5-2410M CPU 2.30GHz Lscpu | grep -iE 'model name|vendor id' Vendor ID: GenuineIntel Now being more specific, filter the output of different commands and print exactly what we need, also use all three sources commands when needed to check cpu info in Linux. ![]() The easiest method is use the cat command and read it, or use the grep command to directly print the filtered results, no root privileges required. This file could be used in different ways to know CPU related info. This file is generated by the kernel during boot, contains some information about the CPU in a human readable format. ![]() Find current, maximum and minimum CPU frequencyĬheck CPU info from the /proc/cpuinfo file in Linux.Find CPU architecture, CPU endianness and supported operation modes.Find number of CPU socket, cores, threads and NUMA nodes.Check CPU info from the /proc/cpuinfo file in Linux.
0 Comments
Leave a Reply. |