Shutdown UNIX Command

How do I shutdown or poweroff a UNIX computer system from a shell prompt?

You can use the halt, poweroff, and shutdown UNIX command line utilities. These command write any pending information to the disks and then stop the processor. The poweroff utility has the machine remove power, if possible. To shutdown UNIX computer immediately type the following command as the root user:
# halt
# poweroff
In this example, shutdown is being executed and is scheduled in 120 seconds. The warning message is output 2 minutes:
# shutdown -y -i 5 -g 120 "===== Disk replacement ====="
Under System V based systems, enter:
# shutdown -y -i 0 -g 10

  • -y : Pre-answer the confirmation question so the command can be run without user intervention.
  • -i init_Level : If there are warnings, init-state specifies the state init is to be in. By default, system state s (single user mode) is used. The -i 5 will shut the machine down so that it is safe to remove the power. The -i 0 will take into firmware on Sun and a few other Unix hardware.
  • -g graceTime : Allow the super user to change the number of seconds from the 60-second default.

To halt the HP-UX unix server system in 10 minutes (600 seconds) with no interactive questions and answers, enter as the root user:
# shutdown -h -y 300

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • chand Sep 19, 2011 @ 11:48

    it will msg that “shutdown command not found”

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum