Report issue Add example

suspend

Suspend execution of the shell

Summary

suspend [-f]

Description

Options

-f: Force suspension of a login shell.

Return Value

Returns success unless job control is not enabled or an error occurs.

Examples

# Open a terminal and get the PID
echo $$
# Suspend execution
suspend
# Open another terminal and send SIGCONT signal
kill -s SIGCONT <PID>
# The original terminal will resume and allow interaction.

Notes

  1. Bash job control commands include bg, fg, kill, wait, disown, and suspend.
  2. This command requires the monitor option to be enabled. Check status with set -o and looking at the monitor row; enable with set -o monitor or set -m.
  3. This is a bash builtin. Use the help command for related information.