WAIT(1)
β¨ WAIT β wait for jobs to complete β¨
okay bestie so this is the fish-shell builtin wait, page WAIT(1), and it's genuinely one of those tiny commands that carries the whole vibe of background jobs π
π«Ά NOTE: this page documents the fish builtinwait. Wanna see the docs for any of the non-fish versions? Just runcommand man waitinstead. iykyk β¨
π SYNOPSIS π
wait [-n | --any] [PID | PROCESS_NAME] ...
π DESCRIPTION π
wait waits for child jobs to complete. that's it, that's the whole thing, and honestly? iconic. π
- if a PID is specified, the command waits for the job that the process with that process ID belongs to. so like, you point at a process, and it waits on the job that process is part of, not just the process alone. π¦
- if a PROCESS_NAME is specified, the command waits for the jobs that the matched processes belong to. (yes, plural β it matches processes, then waits on their jobs π)
- if you specify neither a pid nor a process name, the command waits for all background jobs. all of them. every single one. no job left behind π
- if the
-nor--anyflag is provided, the command returns as soon as the first job completes π₯ if it's not provided, it returns after all jobs complete. so-nis the "i'm impatient, give me whoever finishes first" mode fr fr - the
-hor--helpoption displays help about using this command πΈ
π EXAMPLE π
first up, spawn sleep in the background and then wait until it finishes:
sleep 10 &
wait $last_pid
okay but what if you've got a whole little squad of jobs? π this spawns five jobs in the background, then waits until all of them finish:
for i in (seq 1 5); sleep 10 &; end
wait
and the main character move π β this spawns five sleep jobs and hoge in the background, then waits until all the sleeps finish, and doesn't wait for hoge:
for i in (seq 1 5); sleep 10 &; end
hoge &
wait sleep
see how wait sleep only cares about the sleeps? selective attention, we stan π§
π Copyright π
fish-shell developers π«Ά
and that's the whole page, bestie β this was WAIT(1) for fish-shell, version 4.9, dated Sep 08, 2026, and yes the header says WAIT(1) too, we love a consistent queen ππΈβ¨
π¦ 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