SSH shutdown command

If you wish to power off your Linux server or Linux VPS you can use the shutdown command in Linux for this.

Why use shutdown?

The command stops the system in a secure way.  All specific software on your machine that is designed to take measures when shutting down will be notified and given enough time.

You also have options on whether to shut the system immediately or after a time period which allows you to schedule future events or notify your users about an upcoming reboot/shutdown.

Shutdown your server

It’s the most basic and simple usage

shutdown

Shutdown and halt afterward

shutdown -h

Shutdown and reboot your server

shutdown -r

Shutdown in a specific time

shutdown now # immediately shuts down the server
shutdown 15:00 # shuts down at 3 PM
shutdown +30 # shuts down in 30 minutes

Cancel scheduled shutdown

If you have used any of the above options to schedule a shutdown and you wish to cancel it you can do that

shutdown -c

Fake shutdown

When you’re developing your software to “understand” about an upcoming shutdown on the machine you can actually send out a fake signal that the server is being shut down.

shutdown -k
  • 0 Uživatelům pomohlo
Byla tato odpověď nápomocná?

Související články

Linux tar Command

The Linux tar command is used to compress and extract files to and from an archive. In this...

How to Install WordPress via SSH

Since WordPress is the most widely used CMS it’s installation process has been made as simple and...

SSH Execute Command on a Remote server

Via SSH you can connect to a remote server’s shell. This will allow you to execute commands on...

How to connect to your shared hosting account via SFTP with FileZilla

SFTP is a convenient way to use SSH, while also using the interface of a simple FTP. In order to...

SSH netstat command

If you wish to debug or track statistics of your network in a Linux environment you can use SSH...