The shutdown and reboot commands: a downloader’s boon(and of course sudo too)
So now on to switching off your computer using the command line. Note that all these require sudo privilege to work.
The commands are pretty self-explainatory but their options are what really is the power of these commands. Of course, shutdown is the best and poweroff, halt and reboot simply call the shutdown command with the exceptions with the use of a few options.
So first the easy ones poweroff, reboot and halt. These can just be used as
Often, when needed to shutdown or reboot instantly using the command line, poweroff and reboot are more useful than manipulating the options of shutdown.
Now the most useful part of shutdown is that you can program the computer should shutdown. This is really useful for all you nightbirds with unlimited like me. I start downloading at 2:15 am and just leave the computer with a shell that’s running the shutdown command take care of shutting down when it’s time: no hassles at all!
The poweroff, halt and reboot can be implemented using shutdown command as
shutdown -h now,
shutdown -h now,
and shutdown -r
The coolest part is that you can automate the time when your computer should switch off using shutdown command.
shutdown -h 07:45
shutdown -h 20:30
would switch off the computer at 07:45am and 8:30pm respectively.
So that’s how you can shutdown the computer, reboot it and also automate the shutdown. Pretty neat huh? And quite easy too!
Since I’ve talked about sudo command, thought I’d write about it as well(there’s nothing much).
sudo stands for Substitute User DO. Basically, the command let’s you execute commands as the all-powerful superuser. Do read about this unique security feature that was partially copied in Vista if you don’t know already.
To execute a command as superuser,
Till next time, ciao!