suspend - macOS


Overview

The suspend command in macOS allows you to put your Mac into a low-power sleep state, preserving its current state and consuming minimal power. This state is often referred to as “hibernation.”

Syntax

suspend [-f] [-p] [-h]

Options/Flags

-f (Force): Force the computer to suspend, even if applications have unsaved changes.

-p (Preserve File Descriptors): Keep open file descriptors after suspending. Use this option with caution, as it may cause unexpected behavior.

-h (Help): Display usage information and exit.

Examples

  • Basic usage:
suspend
  • Force suspend:
suspend -f
  • Preserve file descriptors:
suspend -p

Common Issues

  • File locking errors: If applications have open file locks, suspending may fail. Use the -f option to override this behavior.

  • Unsaved changes: When using the -f option, unsaved changes may be lost. Consider saving your work before suspending.

Integration

  • Remote Wake: You can use Remote Wake to wake your Mac from a suspended state over a network connection. See the remotewakeon command for more information.

  • Power Management: suspend works in conjunction with other power management tools in macOS to optimize energy efficiency. Configure power management settings in System Preferences > Energy Saver.

  • hibernate: Similar to suspend, but enters a deeper sleep state that consumes even less power.
  • shutdown: Shuts down the computer completely.
  • sleep: Puts the computer into a sleep state, preserving memory but drawing more power than suspend.