Move foreground terminal jobs to run in the background
bg [job_spec ...]
job_spec (optional): Specifies the job identifier to be moved to the background for execution, which can be one or more.
Returns successful unless job control is not enabled or an error occurs.
#Run the sleep command and press ctrl+z.
sleep 60
^Z
[1]+ Stopped sleep 60
# Use the bg command to run the job in the background.
bg %1
# returned messages:
[1]+sleep 60&
The job control commands of bash include bg fg kill wait disown suspend.
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.
This command is a built-in bash command. For related help information, please see the help command.
优先推荐相关内容,同时保留你的阅读轨迹和收藏入口。