How to shutdown/poweroff a Linux / Unix machine via command line

To shutdown the Linux machine you can use  the  shutdown, halt, Poweroff  and reboot command as a root. There are many way to shudown a Linux / Unix machine via command line shown bellow.

To poweroff a linux machine with ‘ reboot ‘ command ,you can use ‘ reboot ‘ command ‘ -P’ or ‘ –poweroff’ option .

[root@localhost ~]# reboot -P

To poweroff a linux machine with ‘ halt ‘command ,you can use ‘ halt ‘ command ‘ -P’ or ‘ –poweroff’ option .

[root@localhost ~]# halt -P

To shutdowna linux machine  immediatly

[root@localhost ~]# shutdown -h now

OR

[root@localhost ~]# poweroff

OR

[root@localhost ~]# shutdown
Shutdown scheduled for Thu 2018-01-04 13:17:12 IST, use ‘shutdown -c’ to cancel.
[root@localhost ~]#
Broadcast message from root@localhost.localadmin (Thu 2018-01-04 13:16:12 IST):

The system is going down for power-off at Thu 2018-01-04 13:17:12 IST![root@localhost ~]#

If you want to shutdown a Linux / Unix machine with a specific time , you can use ‘shutdown ‘ command with ‘ -P ‘ or ‘ –poweroff ‘ option.

Syntax:  shutdown [OPTIONS] [TIME in 24 Howr format] [Wall Message]

[root@localhost ~]# shutdown -P +10 ” The system is shutdown after 10 minute due to hardware replace “
Shutdown scheduled for Thu 2018-01-04 12:27:43 IST, use ‘shutdown -c’ to cancel.
[root@localhost ~]#
Broadcast message from root@localhost.localadmin (Thu 2018-01-04 12:17:43 IST):

The system is shutdown after 10 minute due to hardware replace
The system is going down for power-off at Thu 2018-01-04 12:27:43 IST!

[root@localhost ~]# 

OR

[root@localhost ~]# shutdown -h +10 ” The system is shutdown after 10 minute due to hardware replace “
Shutdown scheduled for Thu 2018-01-04 12:42:23 IST, use ‘shutdown -c’ to cancel.
[root@localhost ~]#
Broadcast message from root@localhost.localadmin (Thu 2018-01-04 12:32:23 IST):

The system is shutdown after 10 minute due to hardware replace
The system is going down for power-off at Thu 2018-01-04 12:42:23 IST!

[root@localhost ~]# 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s