Linux: poweroff command to poweroff linux/Unix machine

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

 

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

[root@localhost ~]# poweroff -f

Powering off.

==>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 poweroff command.

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

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

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

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

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

All command line options  used with the ‘ poweroff ‘ 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

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