{"id":23716,"date":"2024-01-25T10:29:08","date_gmt":"2024-01-25T10:29:08","guid":{"rendered":"https:\/\/linuxways.net\/?p=23716"},"modified":"2024-01-25T10:44:27","modified_gmt":"2024-01-25T10:44:27","slug":"use-reboot-command-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/use-reboot-command-debian-12\/","title":{"rendered":"How to Use reboot Command in Debian 12"},"content":{"rendered":"<p>Rebooting or restarting a system is an important task that helps you resolve the issues related to the updates and apply changes to the system after configuration. In some cases, you might have to reboot your system for regular releases and updates. It also helps you to recover a system from temporary glitches, making it start over again. It is important to reboot the system securely to avoid the data loss and failure of the system.<\/p>\n<p>The widely used command to reboot the Linux system, including Debian 12 is the<strong> reboot <\/strong>command that can be used in different ways. Read this guide to find how you can reboot your Debian system with the <strong>reboot <\/strong>command.<\/p>\n<p><strong>Quick Outline<\/strong><\/p>\n<ul>\n<li><strong>How to Use reboot Command in Debian 12<\/strong><\/li>\n<li><strong>How to Check Reboot Logs in Debian 12<\/strong><\/li>\n<li><strong>What are the Other Ways to Reboot a Debian 12<\/strong><\/li>\n<li><strong>Conclusion<\/strong><\/li>\n<\/ul>\n<h2><strong>How to Use reboot Command in Debian 12<\/strong><\/h2>\n<p>Debian comes with numerous options to restart the system through the command line. The recommended and widely used command to reboot Debian is the <strong>reboot <\/strong>command that helps your system to restart so that a specific application will work properly.<\/p>\n<p><strong>Note: <\/strong>Before rebooting your Debian system, practice the following to minimize the data loss and successfully reboot the system:<\/p>\n<ul>\n<li>Save your work and close the applications to avoid data loss.<\/li>\n<li>Perform all the pending updates before rebooting a system.<\/li>\n<li>Ensure all the system services are running after a reboot.<\/li>\n<\/ul>\n<p>The <strong>reboot <\/strong>command used to restart a system requires root or sudo user privileges. You have to enter the <strong>sudo<\/strong> prefix before executing the <strong>reboot<\/strong> commands for some users.<\/p>\n<p>To switch to the root user on Debian 12, you can use:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">su<\/span> -<\/div><\/div>\n<p>Once you have switched to the root user, you can immediately reboot Debian system by executing the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">reboot<\/div><\/div>\n<p><strong>OR<\/strong><\/p>\n<p>You can also use the <strong>reboot <\/strong>command with sudo privileges to reboot Debian without switching to the root user, this can be done using:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> reboot<\/div><\/div>\n<p>Alternatively, you can also use the<strong> reboot<\/strong> command in the following way to reboot your Debian system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"sy0\">\/<\/span>sbin<span class=\"sy0\">\/<\/span>reboot<\/div><\/div>\n<p>Once you execute the <strong>reboot <\/strong>command, it will shut down your system and restart it, resulting in a complete reboot of a system.<\/p>\n<p>The <strong>reboot <\/strong>command allows the users to specify the behavior by providing various options while executing the command. The basic syntax of using the <strong>reboot <\/strong>command in Debian 12 is as follows:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">reboot <span class=\"br0\">&#91;<\/span>options<span class=\"br0\">&#93;<\/span><\/div><\/div>\n<p>For example, you can use the <strong>-f<\/strong> flag with the <strong>reboot <\/strong>command to force restart your system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">reboot <span class=\"re5\">-f<\/span><\/div><\/div>\n<p>To get the information related to the available options that can be used with the <strong>reboot <\/strong>command on Debian, run the following command on your terminal:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">reboot <span class=\"re5\">--help<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"358\" class=\"wp-image-23737\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-1.png 728w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-1-300x148.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/p>\n<p>The following parameters can be used with the <strong>reboot<\/strong> command:<\/p>\n<p>1:<strong> &#8211;halt<\/strong>: This option is used to halt or stop the working of the system before restarting it.<\/p>\n<p>2: <strong>-w or -wtmp-only<\/strong>: This option only writes the record to the <strong>\/var\/log\/wtmp<\/strong> file and doesn&#8217;t perform the reboot.<\/p>\n<p>3: <strong>-p<\/strong>: This option shuts down the system completely instead of rebooting it, and it works in the same way as other commands such as shutdown.<\/p>\n<p>4: <strong>-f<\/strong>: This option performs the force restart of the system.<\/p>\n<p>5: <strong>-d<\/strong>: It reboots the system, but doesn&#8217;t write the reboot in the record files.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>How to Check Reboot Logs in Debian 12<\/strong><\/h2>\n<p>When you execute the reboot command, your logs will be stored in the <strong>\/var\/log\/wtmp <\/strong>file on your system. To access your reboot logs or last reboot on Debian, you can execute the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">last<\/span> reboot<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"238\" class=\"wp-image-23738\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-2.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-2-300x98.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<p><strong>Note:<\/strong> Ensure switching to root user to view the logs.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>What are the Other Ways to Reboot a Debian 12<\/strong><\/h2>\n<p>If the <strong>reboot <\/strong>command does not work on your Debian 12, you can either reboot your system from GUI or you can use the numerous other commands in the terminal. If you want to reboot a system through GUI, you can simply navigate to the Gnome menu and choose the <strong>Restart <\/strong>option under <strong>Power Off<\/strong> options:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"879\" height=\"519\" class=\"wp-image-23760\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-3.png 879w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-3-300x177.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-23716-3-768x453.png 768w\" sizes=\"auto, (max-width: 879px) 100vw, 879px\" \/><\/p>\n<p>However, if you prefer working in the terminal, you can use numerous commands to reboot your system. We have mentioned the commands in the following section:<\/p>\n<h2><strong>Command 1: Reboot Debian 12 Using systemctl Command<\/strong><\/h2>\n<p>The first command is the <strong>systemctl <\/strong>command. The systemd is the init system and on Debian, you can reboot or halt your system using the systemd interface. systemctl command is used when you have to manage services such as SSH, NFS, etc., and change the system state such as rebooting, or shutdown the system. The programs receive the signals and then perform specific actions.<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl reboot<\/div><\/div>\n<h2><strong>Command 2: Reboot Debian 12 Using shutdown Command<\/strong><\/h2>\n<p>The second command is the <strong>shutdown <\/strong>command, this command powers off the system. It has various parameters that can be used to restart the system immediately or schedule the restart. To immediately restart your system, you can run the command with the<strong> -r <\/strong>option. It is the most secure command to restart your system as it syncs the drives and terminates the process, providing a fresh restart to the system. This command is an alias of the reboot command.<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> shutdown <span class=\"re5\">-r<\/span> now<\/div><\/div>\n<p>The following command can be used to add a few-minute delay if you want to schedule a system restart:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">shutdown <span class=\"re5\">-r<\/span> <span class=\"br0\">&#91;<\/span>Scheduled Time<span class=\"br0\">&#93;<\/span><\/div><\/div>\n<p>In the below example command, we have scheduled the restart of the system at 19:30 or 7:30 PM:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">shutdown <span class=\"re5\">-r<\/span> <span class=\"nu0\">19<\/span>:<span class=\"nu0\">30<\/span><\/div><\/div>\n<h2><strong>Command 3: Reboot Debian 12 Using \/sbin\/init Command<\/strong><\/h2>\n<p>The third command is the <strong>\/sbin\/init<\/strong> that manages the restart and shutdown of the system through the terminal. When you execute this command with the number 6, it immediately restarts your system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"sy0\">\/<\/span>sbin<span class=\"sy0\">\/<\/span>init <span class=\"nu0\">6<\/span><\/div><\/div>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Rebooting is the option that many of us rely on whenever something goes wrong on your system<\/p>\n<p>It is an important task to run your device smoothly and efficiently. It is necessary when you update or upgrade the system and is the best way to improve the overall performance. The <strong>reboot<\/strong> command is widely used on Linux systems for rebooting the system. You can also customize the <strong>reboot <\/strong>command using the various options that better match your needs. Once you execute the <strong>reboot<\/strong> command, it will clear the system memory, refresh the settings, and allow any updates to take place.<\/p>","protected":false},"excerpt":{"rendered":"<p>You can use the reboot command in Debian 12 to immediately shut down and restart your device to improve its overall performance.<\/p>","protected":false},"author":115,"featured_media":23829,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-23716","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/23716","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=23716"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/23716\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/23829"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=23716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=23716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=23716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}