Linux: halt command to halt the linux server

To halt the liux /Unix machine ,you can use  halt command as a root . There are many options used with halt command. With the help of these options we can halt,reboot and poweroff the linux machine.

==>If you want to poweroff the linux / Unix machine with halt command ,you acn use ‘-p ‘ or ‘–poweroff’ option.

[root@localhost ~]# halt –poweroff

==>If you want to Force immediate halt/power-off/reboot the linux / Unix machine ,you can use  ‘-f’ or ,’ –force ‘ option with ‘halt’ command.

[root@localhost ~]# halt -f

Halting.

==>If you want to Only write wtmp shutdown entry in /var/log/wtmp, do not actually halt, power-off, reboot the linux machine, you acn use ‘-w ‘or ‘ –wtmp-only’ option with halt command.

[root@localhost ~]# halt -w
[root@localhost ~]#

==>If you don’t write wtmp record in /var/log/wtmp ,you can use ‘ -d’ or ‘–no-wtmp ‘ option with halt command.

[root@localhost ~]# halt –no-wtmp

==>If you don’t send wall message before halt/power-off/reboot,you can use halt command witn ‘–no-wall  ‘ option.

root@localhost ~]# halt –no-wall ” please save your work system reboot now”

All command line options  used with the ‘ halt ‘ command are shown below

______________________________________________________________________________

Options                                                  Description

_______________________________________________________________________________

–halt                                         Halt the machine
-p    –poweroff                        Switch off the machine
–reboot                                     Reboot the machine
-f –force                                    Force immediate halt/power-off/reboot
-w –wtmp-only                          Don’t halt/power-off/reboot, just write wtmp record
-d –no-wtmp                             Don’t write wtmp record
–no-wall                                    Don’t send wall message before halt/power-off/reboot

_______________________________________________________________________________

Leave a Reply

Please log in using one of these methods to post your comment:

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 )

Connecting to %s