In linux there are some terminal commands to perform shutdown/power off, restart, sleep and lock. You can also use this when GUI freezes or ...
How to use shutdown/power off, restart/reboot, sleep/suspend and lock commands in linux
![]() |
shutdown, restart, sleep commands in linux |
Today you will learn How to use Shutdown, Reboot, Scheduled Shutdown, sleep and lock in linux using Terminal commands.
Shutdown Immediately
$sudo shutdown now (or) poweroff
- Open the terminal.
- Type "sudo shutdown now" and press ENTER.
Scheduled shutdown
![]() |
Schedule Shutdown |
$sudo shutdown +10 (this 10 indicates, Ten minutes)
- Just type "sudo shutdown -h +(No.of minutes)" press ENTER.
- The system will shutdown when the given time is Reached.
To cancel the scheduled shutdown
$sudo shutdown -c
- Type "sudo shutdown -c" press ENTER.
- This will cancel the scheduled shutdown.
Scheduled shutdown with message
- Type the above command and press ENTER.
- To shut down with a message.
Shutdown by time
$sudo shutdown +09:00 (hour:minutes)
- Write "shutdown +09:00" and press ENTER.
Reboot
$shuutdown -r (or) reboot
- To Reboot your computer.
- Just say "shutdown -r" (or) "reboot" and press ENTER.
Lock
$loginctl lock-session
- Type "loginctl lock-session" and press ENTER.
- To Lock your System.
Suspend
$systemctl suspend
- Just write "systemctl suspend" press ENTER.
- To Suspend your system.
Conclusion
In this way you can perform Shutdown, Scheduled Shutdown, Reboot, Lock and Suspend in Linux.
HAVE A NICE DAY 💙