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 789 will 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 banana or bg banana 123 will complain that "banana" is not a valid process ID. bestie. banana. 🍌
  • bg %2 will background job 2.

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