2019-03-31 17:05:09 +08:00
.. _cmd-bg:
2018-12-17 09:39:33 +08:00
bg - send jobs to background
2019-01-03 12:10:47 +08:00
============================
2018-12-17 09:39:33 +08:00
2018-12-18 09:58:24 +08:00
Synopsis
--------
2018-12-17 05:08:41 +08:00
2019-09-17 17:59:04 +08:00
::
2018-12-18 09:58:24 +08:00
2019-09-17 17:59:04 +08:00
bg [PID...]
2018-12-17 05:08:41 +08:00
2018-12-19 10:44:30 +08:00
Description
2019-01-03 12:10:47 +08:00
-----------
2018-12-17 05:08:41 +08:00
2019-03-31 03:44:07 +08:00
`` bg `` sends `jobs <index.html#syntax-job-control> `__ to the background, resuming them if they are stopped.
2018-12-17 05:08:41 +08:00
A background job is executed simultaneously with fish, and does not have access to the keyboard. If no job is specified, the last job to be used is put in the background. If PID is specified, the jobs with the specified process group IDs are put in the background.
When at least one of the arguments isn't a valid job specifier (i.e. PID),
2018-12-20 04:02:45 +08:00
`` bg `` will print an error without backgrounding anything.
2018-12-17 05:08:41 +08:00
When all arguments are valid job specifiers, bg will background all matching jobs that exist.
2018-12-19 10:44:30 +08:00
Example
2019-01-03 12:10:47 +08:00
-------
2018-12-17 05:08:41 +08:00
2018-12-20 04:02:45 +08:00
`` bg 123 456 789 `` will background 123, 456 and 789.
2018-12-17 05:08:41 +08:00
If only 123 and 789 exist, it will still background them and print an error about 456.
2018-12-20 04:02:45 +08:00
`` bg 123 banana `` or `` bg banana 123 `` will complain that "banana" is not a valid job specifier.