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:
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
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop