bg command in Linux with Examples
bg command in linux is used to place foreground jobs in background.
Syntax:
bg [job_spec ...]
job_spec may be:
%n: Refer to job number n.
%str: Refer to a job which was started by a command beginning with str.
%?str: Refer to a job which was started by a command containing str.
%% or %+: Refer to the current job. fg and bg will operate on this job if no job_spec is given.
%-: Refer to the previous job.
Options for bg command:
- bg [JOB_SPEC] : This command is used to put the mentioned job in background. In the below screenshot, we do following :
- We use jobs command to list all jobs
- We create a process using sleep command, we get its ID as 1.
- We put it in background by providing its ID to bg.

‘sleep 500’ is used to create dummy foreground job. - bg –help : This command displays help information.
Recommended Posts:
- tar command in Linux with examples
- cmp Command in Linux with examples
- id command in Linux with examples
- cut command in Linux with examples
- pwd command in Linux with Examples
- tty command in Linux with examples
- gs command in Linux with Examples
- dir command in Linux with examples
- col command in Linux with Examples
- fmt command in Linux with examples
- fg command in Linux with examples
- w command in Linux with Examples
- ed command in Linux with examples
- wc command in Linux with examples
- man command in Linux with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

