From the user's viewpoint, stopping (shutting down) a system is simple. However, from the system's viewpoint, the shutdown process actually involves a series of events designed to preserve file integrity.
The shutdown command is the safest and most thorough way to halt the operating system. When you designate the appropriate flags, this command notifies users that the system is about to go down, kills all existing processes, unmounts file systems, and halts the system. See the following information for more about shutting down your system:
Understanding the Shutdown Process
Shutting Down the System
Shutting Down the System to Single-User Mode
Shutting Down the System in an Emergency