BG(1)
π BG(1) β fish-shell, bestie
okay so this is the bg girlie from fish-shell, and she's about to become your new fave π
β¨ NAME β¨
bg β send jobs to background π
β¨ SYNOPSIS β¨
bg [PID ...]
β¨ DESCRIPTION β¨
So bg takes jobs (iykyk β the whole #syntax-job-control situation) and yeets them into the background, resuming them if they were stopped. Iconic behaviour, honestly. π
A background job runs at the same time as fish and does not have access to the keyboard. No keyboard for you, background job, go sit over there. πͺ
- If you don't specify a job, the last job to be used gets put in the background.
- If you do give
PIDs, the jobs containing those process IDs get put in the background.
A PID in the format %n, where n is an integer, gets interpreted as the PID of job number n. Where do you find job numbers? In the output of jobs <>, bestie. (Yes that's the literal link, I don't make the rules π«Ά)
Now the important part, listen up:
When at least one of the arguments isn't a valid job specifier, bg prints an error and backgrounds nothing. Zero. Nada. So dramatic, but fair. π
When all the arguments are valid job specifiers, bg backgrounds all the matching jobs that exist. Slay.
The -h or --help option displays help about using this command. Very demure, very mindful. β¨
β¨ EXAMPLE β¨
The typical use is to run something, stop it with ctrl-z, and then continue it in the background with bg. It's giving main character energy:
> find / -name "*.js" >/tmp/jsfiles 2>/dev/null # oh no, this takes too long, let's press Ctrl-z!
fish: Job 1, 'find / -name "*.js" >/tmp/jsfilβ¦' has stopped
> bg
Send job 1 'find / -name "*.js" >/tmp/jsfiles 2>/dev/null' to background
> # I can continue using this shell!
> # Eventually:
fish: Job 1, 'find / -name "*.js" >/tmp/jsfilβ¦' has ended
More scenarios, because we love range π
bg 123 456 789will background the jobs that contain processes 123, 456 and 789.- If only 123 and 789 exist, it will still background them and print an error about 456. Not me getting a partial win π
bg 123 bananaorbg banana 123will complain that"banana"is not a valid process ID. bestie. banana. πbg %2will background job 2.
β¨ Copyright β¨
fish-shell developers π
and that's the whole vibe check, bestie β this page is from fish-shell, version 4.9, dated Sep 08, 2026. go forth and background responsibly π¦π
π¦ where this page comes from
- arch rolling: fish 4.9.3-1 Β· GPL-2.0-only AND BSD-3-Clause AND ISC AND MIT AND PSF-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms