{"id":14169,"date":"2023-04-24T18:30:38","date_gmt":"2023-04-24T18:30:38","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=14169"},"modified":"2023-10-07T14:34:44","modified_gmt":"2023-10-07T14:34:44","slug":"how-to-check-cpu-on-ubuntu","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-check-cpu-on-ubuntu\/","title":{"rendered":"How to Check CPU on Ubuntu"},"content":{"rendered":"<p><img decoding=\"async\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-1024x878.jpg\" alt=\"How to Check CPU on Ubuntu\" width=\"1024\" height=\"878\" class=\"alignnone size-large wp-image-18480 lazyload\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-1024x878.jpg 1024w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-300x257.jpg 300w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-128x110.jpg 128w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-420x360.jpg 420w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-540x463.jpg 540w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-720x617.jpg 720w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-960x823.jpg 960w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-1140x977.jpg 1140w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-1166x999.jpg 1166w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-840x720.jpg 840w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu-1260x1080.jpg 1260w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/04\/How-to-Check-CPU-on-Ubuntu.jpg 1400w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/878;\" \/><\/p>\n<p><a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-ubuntu-beginners-guide-ubuntu-linux-distro\/\">Ubuntu<\/a>, a popular Linux distribution, is widely used in various environments, from personal computers to <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS<\/a> and <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated servers<\/a>.<\/p>\n<p>One of the key aspects of maintaining a healthy system is monitoring its performance. The Central Processing Unit (in short &#8211; CPU), being the heart of a <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-are-web-servers-and-why-are-they-needed\/\">web server<\/a>, plays a pivotal role in system performance. Thus, understanding how to check the CPU&#8217;s status and information is crucial for any Ubuntu user.<\/p>\n<p>In this guide, we will go through the various options to check CPU information on Ubuntu using the command line.<\/p>\n<p>Let&#8217;s get started!<\/p>\n<h2>Step 1: Open the Terminal<\/h2>\n<p>The first step is to open the terminal on your Ubuntu machine. You can do this by clicking on the terminal icon or by using the keyboard shortcut &#8220;Ctrl + Alt + T&#8221;.<\/p>\n<h2>Step 2: Check CPU Information Using the lscpu Command<\/h2>\n<p>The &#8220;lscpu&#8221; command displays the CPU information on your Ubuntu machine. To use this command, open a terminal and type the following command:<\/p>\n<pre>\r\nlscpu\r\n<\/pre>\n<p>The output will display detailed information about the CPU, including the number of cores, clock speed, cache size, and other features.<\/p>\n<pre>\r\nArchitecture:        x86_64\r\nCPU op-mode(s):      32-bit, 64-bit\r\nByte Order:          Little Endian\r\nCPU(s):              8\r\nOn-line CPU(s) list: 0-7\r\nThread(s) per core:  1\r\nCore(s) per socket:  1\r\nSocket(s):           8\r\nNUMA node(s):        1\r\nVendor ID:           GenuineIntel\r\nCPU family:          6\r\nModel:               106\r\nModel name:          Intel(R) Xeon(R) Gold 6336Y CPU @ 2.40GHz\r\nStepping:            6\r\nCPU MHz:             2399.998\r\nBogoMIPS:            4799.99\r\nVirtualization:      VT-x\r\nHypervisor vendor:   KVM\r\nVirtualization type: full\r\nL1d cache:           32K\r\nL1i cache:           32K\r\nL2 cache:            4096K\r\nL3 cache:            16384K\r\nNUMA node0 CPU(s):   0-7\r\n<\/pre>\n<h2>Step 3: Check CPU Usage Using the top Command<\/h2>\n<p>The &#8220;top&#8221; command displays the real-time CPU usage on your Ubuntu machine. To use this command, open a terminal and type the following command:<\/p>\n<pre>\r\ntop\r\n<\/pre>\n<p>The output will display a live view of the system processes, including CPU usage, memory usage, and other details. To exit the &#8220;top&#8221; command, press &#8220;q&#8221; on your keyboard.<\/p>\n<pre>\r\ntop - 14:29:29 up 20 days, 22:30,  2 users,  load average: 0.02, 0.01, 0.00\r\nTasks: 179 total,   1 running, 114 sleeping,   0 stopped,   0 zombie\r\n%Cpu(s):  0.0 us,  0.0 sy,  0.0 ni, 99.9 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st\r\nKiB Mem : 16424164 total, 11682752 free,  1473220 used,  3268192 buff\/cache\r\nKiB Swap:        0 total,        0 free,        0 used. 14545440 avail Mem\r\n\r\n  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND\r\n19454 root      20   0   42812   3964   3296 R   0.3  0.0   0:00.02 top\r\n    1 root      20   0  225268   8920   6560 S   0.0  0.1   0:46.72 systemd\r\n    2 root      20   0       0      0      0 S   0.0  0.0   0:00.60 kthreadd\r\n    4 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker\/0:0H\r\n    6 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 mm_percpu_wq\r\n    7 root      20   0       0      0      0 S   0.0  0.0   0:01.83 ksoftirqd\/0\r\n    8 root      20   0       0      0      0 I   0.0  0.0   3:10.29 rcu_sched\r\n    9 root      20   0       0      0      0 I   0.0  0.0   0:00.00 rcu_bh\r\n   10 root      rt   0       0      0      0 S   0.0  0.0   0:00.73 migration\/0\r\n   11 root      rt   0       0      0      0 S   0.0  0.0   0:04.08 watchdog\/0\r\n   12 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp\/0\r\n   13 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp\/1\r\n   14 root      rt   0       0      0      0 S   0.0  0.0   0:03.22 watchdog\/1\r\n   15 root      rt   0       0      0      0 S   0.0  0.0   0:00.76 migration\/1\r\n   16 root      20   0       0      0      0 S   0.0  0.0   0:00.92 ksoftirqd\/1\r\n   18 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker\/1:0H\r\n   19 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp\/2\r\n   20 root      rt   0       0      0      0 S   0.0  0.0   0:03.19 watchdog\/2\r\n   21 root      rt   0       0      0      0 S   0.0  0.0   0:00.77 migration\/2\r\n   22 root      20   0       0      0      0 S   0.0  0.0   0:00.91 ksoftirqd\/2\r\n   24 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker\/2:0H\r\n   25 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp\/3\r\n   26 root      rt   0       0      0      0 S   0.0  0.0   0:03.12 watchdog\/3\r\n   27 root      rt   0       0      0      0 S   0.0  0.0   0:00.78 migration\/3\r\n   28 root      20   0       0      0      0 S   0.0  0.0   0:00.96 ksoftirqd\/3\r\n   30 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker\/3:0H\r\n   31 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp\/4\r\n   32 root      rt   0       0      0      0 S   0.0  0.0   0:03.05 watchdog\/4\r\n   33 root      rt   0       0      0      0 S   0.0  0.0   0:00.81 migration\/4\r\n   34 root      20   0       0      0      0 S   0.0  0.0   0:00.90 ksoftirqd\/4                                              \r\n<\/pre>\n<h2>Step 4: Check CPU Temperature Using the lm-sensors Package (Optional)<\/h2>\n<p>The &#8220;lm-sensors&#8221; package is a command-line tool that can be used to monitor the temperature sensors on your Ubuntu machine, including the CPU temperature. To install &#8220;lm-sensors&#8221;, open a terminal and type the following command:<\/p>\n<pre>\r\nsudo apt-get install lm-sensors\r\n<\/pre>\n<p>Once installed, you can use the &#8220;sensors&#8221; command to display the CPU temperature. To use this command, open a terminal and type the following command:<\/p>\n<pre>\r\nsensors\r\n<\/pre>\n<p>The output will display the temperature sensors on your Ubuntu machine, including the CPU temperature.<\/p>\n<h2>Commands Mentioned:<\/h2>\n<ul>\n<li><span class=\"fw-bold\">lscpu<\/span> &#8211; a command that displays the CPU information on your Ubuntu machine.<\/li>\n<li><span class=\"fw-bold\">top<\/span> &#8211; a command that displays the real-time CPU usage on your Ubuntu machine.<\/li>\n<li><span class=\"fw-bold\">sudo<\/span> &#8211; a command that allows users to run programs with the security privileges of another user, typically the superuser.<\/li>\n<li><span class=\"fw-bold\">apt-get<\/span> &#8211; a command-line tool used to manage packages on Ubuntu.<\/li>\n<li><span class=\"fw-bold\">lm-sensors<\/span> &#8211; a package that can be used to monitor the temperature sensors on your Ubuntu machine.<\/li>\n<li><span class=\"fw-bold\">sensors<\/span> &#8211; a command that displays the temperature sensors on your Ubuntu machine.<\/li>\n<\/ul>\n<h2>Conclusion:<\/h2>\n<p>In this guide, we have outlined the steps to check CPU information on Ubuntu using the command line. By using the &#8220;lscpu&#8221; and &#8220;top&#8221; commands, you can easily obtain the necessary information about the CPU on your Ubuntu machine.<\/p>\n<p>Ever wondered which hosting providers are leading the pack in 2023? We&#8217;ve got you covered. Dive into our latest article, &#8216;<a href=\"https:\/\/webhostinggeeks.com\/best\/ubuntu-hosting\/\">Best Ubuntu Hosting 2023<\/a>&#8216;, where we&#8217;ve handpicked and tested the best of the best<\/p>\n<p>If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu, a popular Linux distribution, is widely used in various environments, from personal computers to VPS and dedicated servers. One of the key aspects of maintaining a healthy system is&#8230;<\/p>\n","protected":false},"author":6,"featured_media":18480,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[996,1073],"tags":[2047,2023,1856],"class_list":["post-14169","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-ubuntu","tag-check","tag-cpu","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/14169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=14169"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/14169\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/18480"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=14169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=14169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=14169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}