Linux Command

suspend

Suspends the execution of the shell.

Summary

suspend [-f]

The main purpose

Options

-f performs a suspend operation on the login shell.

return value

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

example

# Open a terminal and first obtain the PID.
echo $$
# Execute the suspend command
suspend
# Open another terminal and send the SIGCONT command
kill -s SIGCONT PID
# At this point, the previous terminal ends the suspended state and can interact normally.

Notice

  1. The job control commands of bash include bg fg kill wait disown suspend.

  2. This command can only be executed when the set option monitor is turned on; to view the job control status: enter set -o to view the monitor line; execute set -o monitor or set -m to turn it on this option.

  3. This command is a built-in bash command. For related help information, please see the help command.

Keep reading

You may need these next

Related picks, plus your reading history and saved articles.