Automatic shutdown of the computer after a specified time in Ubuntu
When a computer replaces your TV, and you are used to watching a movie on the Internet before going to bed, automatically turning off the computer on a timer is a useful thing. And on a laptop, it is simply necessary, because it is special not to leave it on all night; if it is on a battery, so as not to discharge to zero, if it is connected to the network, so as not to overheat.
On a Windows computer, to turn off the PC automatically, I used the Aimp audio player, there is an option in the settings to turn off the computer on a schedule.
On an Ubuntu computer, there is built-in functionality, no need to install additional applications for this.
You need to open a terminal with a command line, to open it you need to click on the desktop of the PC or press CTRL+T.
To set the time for automatic shutdown of the computer, enter the command in the terminal:
180 is the time in minutes.
Instead of 180, you can specify any number of minutes, for example, for the computer to turn off after an hour, the command will look like this:
After entering the command, you need to press Enter and then enter your password (it is not displayed when you enter it, but it will be accepted)
If you change your mind, you can cancel the auto shutdown with the command
Beauty!
On a Windows computer, to turn off the PC automatically, I used the Aimp audio player, there is an option in the settings to turn off the computer on a schedule.
On an Ubuntu computer, there is built-in functionality, no need to install additional applications for this.
You need to open a terminal with a command line, to open it you need to click on the desktop of the PC or press CTRL+T.
To set the time for automatic shutdown of the computer, enter the command in the terminal:
sudo shutdown -h 180
180 is the time in minutes.
Instead of 180, you can specify any number of minutes, for example, for the computer to turn off after an hour, the command will look like this:
sudo shutdown -h 60
After entering the command, you need to press Enter and then enter your password (it is not displayed when you enter it, but it will be accepted)
If you change your mind, you can cancel the auto shutdown with the command
sudo shutdown -c
Beauty!