Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • SSD (Solid State Drive) Buying Guide for 2019 Computer Tips
  • 10 Best Screen Recorders for Linux Linux Tips
  • Maono DM30 USB Microphone: The Best Budget Microphone in 2023? Gadgets
  • How to Pay For Spotify Premium Outside The US How-To
  • What Is Private DNS and How to Use It Computer Tips
  • 3 Best Virtual Debit Card Services Cool Websites
  • What Is Superfetch (Sysmain) On Windows 10 And How To Disable It Help Desk
  • 10 + Best Free Mac Games 2023 OS X

Shutdown and Restart Your Computer From The Ubuntu Terminal

Posted on October 9, 2020 By blog_786 No Comments on Shutdown and Restart Your Computer From The Ubuntu Terminal

In Linux, it is quite easy (as in most operating systems) to restart your computer, log out of your user account, or shut down the system completely. Often, you just have to press the power button on your computer or a button on the toolbar. On Ubuntu, you will see a window like this.

Shutdown and Restart Your Computer From The Ubuntu Terminal

You will be able to immediately shut down your computer (after logging out), restart your computer, log out, etc.

All of this can also be done through the Terminal, which is especially convenient for those Ubuntu users who always open a Terminal session. This method also includes several options, especially for shutting down your system.

Shut down Ubuntu from Terminal

First, we’ll open a terminal.

– /

Before we get to the commands, please note that many of our actions will immediately end your current session, so it is recommended that you save everything while you browse this tutorial so that if – by accident – you turn off your computer by mistake, you will not lose anything.

Nevertheless, let’s go.

The first thing we’ll talk about is shutting down your computer. We will do this using the shutdown command. In the simplest case, we can shutdown the computer by entering the following into Terminal:

sudo shutdown -h now

If you haven’t taken any action recently as an administrator, you will be prompted for a password. After you successfully enter it, your computer will immediately start shutdown procedure.

Using this command basically gives your computer the ability to either stop or shutdown, and then does so immediately. Stopping simply stops all running processes, making it safe to shut down the computer, and the poweroff command does both.

Note: if you want to stop, you can also type sudo halt in Terminal.

If you want to make sure your system shuts down or shuts down by default, the following commands do just that.

sudo shutdown -P HH: MM

or

sudo shutdown -H HH: MM

In any case, time at the end is necessary. If you enter sudo shutdown -P or sudo shutdown -H without a timeout, a message appears stating that time is needed.

What if you need a little more control? The shutdown command has many parameters. For example, if you want to shutdown your computer after 30 minutes, then use the command sudo shutdown +30.

If you want to shutdown your computer at 5:30 pm (for example), use the sudo shutdown command at 5:30 pm.

Note: all commands that require time use 24 hour time even if your clock is set to 12 hour time, so sudo shutdown 5:30 would be 5:30 AM.

Finally, if you’ve used one of these time-bound examples and realize that you want to continue using your computer, typing sudo shutdown -c in another Terminal session will cancel the scheduled shutdown.

If you want to restart your computer, you have two options. The first still uses the shutdown command, but at the end it adds a parameter that tells your system to reboot after a successful shutdown.

Of course, typing sudo shutdown -r isn’t necessarily intuitive, so luckily we can just type sudo reboot into Terminal to do the same.

Finally, on some systems, the standard logout screen has hibernation or suspend options. The suspend setting saves your current state, then “almost” turns off so you can quickly return to your current state. While suspended, your computer is still using power (which is important when using a laptop). Hibernation is similar to suspending, except that your current state is saved to disk and the computer is turned off. You will need to reboot the system, but you can return to your current state after restarting. To perform any of these actions from the command line, use the Power Manager command.

Typing sudo pm-suspend will suspend your computer.

Likewise, sudo pm-hibernate is the command that puts it into hibernation.

And it’s all. The basic shutdown and reboot commands can be very simple, but with the addition of the mentioned modifiers (in addition to the hibernation and suspend commands) you have a very complete set of commands for managing your session, all from a basic Terminal session.

–

Share this:

  • Twitter
  • Facebook
Linux Tips

Post navigation

Previous Post: Create and Edit Zip Files In Linux Using The Terminal
Next Post: Track and Log USB Device Usage/Activity with USBLogView

Related Posts

  • 5 Great Reasons to Ditch Windows for Linux Linux Tips
  • Use MSStyles to Theme Wine Applications In Linux Linux Tips
  • How to Uninstall Ubuntu in a Windows 10 Dual-Boot System Linux Tips
  • Make a Custom Live Linux Distro with Linux Live Kit Linux Tips
  • Common Reasons for Ubuntu Crashes and How to Recover Linux Tips
  • Display a List of Recently Installed Software Packages in Ubuntu Linux Tips

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • 6 Best FTP Clients For Android
  • MailTag: Real-time Email Tracking, Made Easy
  • Here are the Top 10 highest paid YouTubers of 2017
  • Protect Your Facebook Account From Hackers (2017)
  • 4 Ways to Share WiFi Without Giving Away Your Password
DMCA.com Protection Status

Recent Posts

  • TemplateMonster WordPress Theme Review – Build a Site With Ease
  • How to use Canva Docs to create documents online
  • PS4 won’t turn on but beeps? 9 Fixes Worth Trying
  • How to Create a Vision Board on Canva
  • How to Cancel Your Wall Street Journal (WSJ) Subscription

Recent Comments

  1. How to Cancel Your Wall Street Journal (WSJ) Subscription on How to Cancel Your New York Times Subscription
  2. How to Fix Spotify Lyrics Not Showing Up on How to Delete or Delete Downloads from Spotify
  3. 6 Best FTP Clients For Android on Disney Plus not working on Fire TV? Try These 8 Fixes
  4. Protect Your Facebook Account From Hackers (2017) on Top 5 Facebook Alternative Apps For iOS Devices
  5. 4 Ways to Share WiFi Without Giving Away Your Password on How to fix if PS5 Not Connecting to Internet?
  • Export SQL Data to Excel with Column Headers How-To
  • 5 Best Remote Control Apps From PC To Android Phone How-To
  • 8 Best Wi-Fi Speed Test Apps for iPhone How-To
  • ATM to ATM Money Transfer Guide for Indian banks How-To
  • Best ti-84 plus graphing calculator 2020 black
  • How to Install and Run Flatpak Applications 2021 Linux
  • Erase Scratches in Photos with the GIMP’s Heal Selection Tool How-To
  • How To Build a Basic Web Presence If You Have No Coding Skills Cool Websites

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version