{"id":44463,"date":"2023-10-02T12:39:31","date_gmt":"2023-10-02T12:39:31","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=44463"},"modified":"2025-01-28T10:23:53","modified_gmt":"2025-01-28T10:23:53","slug":"command-cpu-power-mode-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2023\/10\/command-cpu-power-mode-ubuntu-22-04\/","title":{"rendered":"Single Command to Change CPU Power Mode in Ubuntu 24.04 | 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/03\/battery-icon.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-38273\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/03\/battery-icon-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/03\/battery-icon-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/03\/battery-icon-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/03\/battery-icon-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/03\/battery-icon-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/03\/battery-icon.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This simple tutorial shows how to switch CPU power mode between &#8216;Performance&#8217;, &#8216;Balanced&#8217;, and &#8216;Power Saver&#8217; using Linux command in Ubuntu 22.04, Ubuntu 23.10, and Ubuntu 24.04.<\/p>\n<p>GNOME has options in both &#8216;Settings&#8217; and top-right system status menu to change CPU frequency by switching between &#8216;Performance&#8217;, &#8216;Balanced&#8217;, and &#8216;Power Saver&#8217;.<\/p>\n<p>It&#8217;s useful for saving battery life while being able to get better performance when gaming or doing heavy work.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/gnome-powermode-settings.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44465\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/gnome-powermode-settings-600x316.webp\" alt=\"\" width=\"600\" height=\"316\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/gnome-powermode-settings-600x316.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/gnome-powermode-settings-300x158.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/gnome-powermode-settings-768x404.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/gnome-powermode-settings-1320x695.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/gnome-powermode-settings.webp 1326w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>For users who want to bind the options to keyboard shortcuts, or make the function into script or even application, here&#8217;s the single command to switch the power mode.<\/p>\n<h3>Single command to change Power Mode in Ubuntu<\/h3>\n<p>NOTE: This tutorial is only tested in Ubuntu (GNOME ONLY) with Intel CPU, though it should also work in Fedora workstation and Debian 12 with GNOME desktop.<\/p>\n<p>The power mode setting option is handled by the <a href=\"https:\/\/gitlab.freedesktop.org\/hadess\/power-profiles-daemon\" target=\"_blank\" rel=\"noopener\">power-profiles-daemon<\/a>. It has a command line tool <code>powerprofilesctl<\/code> to check current and switch power profile.<\/p>\n<p><b>To switch power mode to &#8216;power-saver&#8217;<\/b> for example, just press <b>Ctrl+Alt+T<\/b> on keyboard to open terminal and run command:<\/p>\n<pre>powerprofilesctl set power-saver<\/pre>\n<p><i>In command, replace <code>power-saver<\/code> with <code>balanced<\/code> or <code>performance<\/code> as you want.<\/i><\/p>\n<p><b>After making change, verify by running command:<\/b><\/p>\n<pre>powerprofilesctl<\/pre>\n<p>In the output, the one with an asterisk &#8216;*&#8217; in the beginning is the power profile currently in use.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/powerctl-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44466\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/powerctl-command-600x407.webp\" alt=\"\" width=\"600\" height=\"407\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/powerctl-command-600x407.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/powerctl-command-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/powerctl-command-768x521.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/powerctl-command.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>For those who want to do the job <b>through D-Bus interface<\/b>, run the single command below instead:<\/p>\n<pre>gdbus call --system --dest net.hadess.PowerProfiles --object-path \/net\/hadess\/PowerProfiles --method org.freedesktop.DBus.Properties.Set 'net.hadess.PowerProfiles' 'ActiveProfile' \"&lt;'power-saver'&gt;\"<\/pre>\n<p><i>Also, change <code>power-saver<\/code> in command with <code>balanced<\/code> or <code>performance<\/code> as need.<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/dbus-powerctl.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44467\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/dbus-powerctl-600x428.webp\" alt=\"\" width=\"600\" height=\"428\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/dbus-powerctl-600x428.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/dbus-powerctl-300x214.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/dbus-powerctl-768x548.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/dbus-powerctl.webp 822w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>View CPU Speed \/ frequency in Real Time<\/h3>\n<p>As mentioned, you can verify CPU power mode by simply running <code>powerprofilesctl<\/code> command.<\/p>\n<p>For choice, you may also see CPU frequency (aka clock speed) in real-time by running command in terminal:<\/p>\n<pre>watch -n 1 \"grep \\\"^[c]pu MHz\\\" \/proc\/cpuinfo\"<\/pre>\n<p>It will show you the speed for all CPU cores, and update every 1 second. As you want, you may replace number 1 in seconds (e.g., 2 for 2 s, or 0.5 for 500 ms).<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/check-cpu-speed.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44468\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/check-cpu-speed-600x407.webp\" alt=\"\" width=\"600\" height=\"407\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/check-cpu-speed-600x407.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/check-cpu-speed-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/check-cpu-speed-768x521.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/check-cpu-speed.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>This simple tutorial shows how to switch CPU power mode between &#8216;Performance&#8217;, &#8216;Balanced&#8217;, and &#8216;Power Saver&#8217; using Linux command in Ubuntu 22.04, Ubuntu 23.10, and Ubuntu 24.04. GNOME has options in both &#8216;Settings&#8217; and top-right system status menu to change CPU frequency by switching between &#8216;Performance&#8217;, &#8216;Balanced&#8217;, and &#8216;Power Saver&#8217;. It&#8217;s useful for saving battery [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":38273,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1515],"class_list":["post-44463","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-power-saving"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/44463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=44463"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/44463\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/38273"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=44463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=44463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=44463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}