Shutdown and restart using commands

Many times we want to know how to turn off the computer, restart it ... each one after a certain time or at an exact time, well, here is how to do this from the terminal:

To shut down the PC:

kzkggaara @ geass: ~ $ sudo shutdown -h now
Nota: It is necessary to enter our root password since administrative permissions are required.

To turn off the PC after a specified time:

kzkggaara @ geass: ~ $ sudo shutdown -h + "desired-time"
Must change ""Desired-time"”For the number or number of minutes to wait before shutting down the system.
Example: sudo shutdown -h +10 // The system will shut down 10 minutes after entering this command line.
Nota: It is necessary to enter our root password since administrative permissions are required.

To turn off the PC at a specific time:

kzkggaara @ geass: ~ $ sudo shutdown -h "desired-time"
Must change ""Desired-time"”By logically the time they want the system to turn off. Clock in 24 hour format, that is; from 0 to 23.
Example: sudo shutdown -h 22:30 // The system will turn off at 22:30 p.m., that is; at 10:XNUMX at night.
Nota: It is necessary to enter our root password since administrative permissions are required.

To restart the PC any of the following:

kzkggaara @ geass: ~ $ sudo shutdown -r now
kzkggaara @ geass: ~ $ sudo reboot
Nota: It is necessary to enter our root password as administrative permissions are required. Also, either of the two previous lines do the same; restart the PC.

To restart the PC after a certain time:

kzkggaara @ geass: ~ $ sudo shutdown -r +"Desired-time"
Must change ""Desired-time" ”For the number or amount of minutes to wait before restarting the system.
Example: sudo shutdown -r +10 // The system will reboot 10 minutes after entering this command line.
Nota: It is necessary to enter our root password since administrative permissions are required.

Related article:
Cron & crontab, explained

To restart the PC at a specific time:

kzkggaara @ geass: ~ $ sudo shutdown -r "Desired-time"
Must change ""Desired-time"”By logically the time they want the system to restart. Clock in 24 hour format, that is; from 0 to 23.
Example: sudo shutdown -r 22:30 // The system will restart at 22:30 p.m., that is; at 10:XNUMX at night.
Nota: It is necessary to enter our root password since administrative permissions are required.

More commands in: Learn to do without the graphical environment