Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11In an interactive Bash session, press Ctrl+Z to suspend a foreground command and reclaim the prompt. Run bg to continue that job in the background, and use fg later to return it to the terminal. The jobs builtin shows the shell’s job numbers and states so you can target the right task.
What foreground and background mean
A foreground job owns the terminal’s input and interactive control. Bash waits for it, and keystrokes such as Ctrl+C or Ctrl+Z are delivered to that job.
A background job continues while Bash displays a prompt for other commands. It normally cannot read from the controlling terminal. If it attempts to do so, Bash documents that it receives SIGTTIN and is ordinarily suspended. Commands that need keyboard input or interactive control therefore belong in the foreground.
Job-control numbers are references maintained by the current shell; they are not process IDs. Job control requires an interactive shell with job control enabled, so behavior in noninteractive scripts, some remote-session managers, and other shells can differ.
#1 Best Overall
Move a running command to the background
-
Start a command normally:
long_command -
Press Ctrl+Z. Bash suspends the foreground job and returns the prompt. This step stops the job; it does not make the job continue running in the background.
-
List the shell’s jobs:
jobsRead the displayed job number and state. Bash may mark the current job with
+and the previous job with-. -
Resume the selected job in the background:
bg %1Replace
%1with the job number shown byjobs. With no jobspec,bguses the shell’s current job.
After bg, the command continues without taking over the terminal. Its output may still appear in the terminal unless you redirected it when launching the command.
Bring a background job back to the terminal
Use fg with the shell job specification:
fg %1
Bash resumes job 1 in the foreground and returns terminal interaction to it. If you omit the jobspec, fg selects the current job. A command that was stopped because it tried to read terminal input can normally proceed once you foreground it.
Start a command in the background immediately
If you know at launch that a command does not need terminal input, append &:
long_command &
Bash starts the command asynchronously and gives you another prompt. Use jobs to inspect it, fg to make it interactive, or bg when continuing a job that was previously stopped.
Understand Bash job specifications
| Notation | Meaning |
|---|---|
%1 |
Shell job number 1, as reported by jobs. |
%+ or %% |
The shell’s current job. |
%- |
The shell’s previous job. |
The + and - markers in relevant jobs output identify the current and previous jobs. These symbols and numbers are shell references, not stable process IDs; they can change as jobs finish or as you create new jobs.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesA complete state-change example
long_command
# press Ctrl-Z
jobs
bg %1
jobs
fg %1
- After
long_command: the command owns the terminal in the foreground. - After Ctrl+Z: the job is stopped and Bash prints a prompt.
- After the first
jobs: you learn the job number and state. - After
bg %1: job 1 is continued in the background. - After the second
jobs: you can verify its current state. - After
fg %1: job 1 is continued in the foreground and receives terminal interaction again.
Monitor or stop a job
Check state with jobs
Run jobs whenever you are unsure whether a job is running, stopped, or finished. Target the job number it displays rather than guessing from a process ID.
Rank #4
Terminate a shell job
The shell can send a signal using its job specification, for example:
kill %1
Use the job’s actual number. A termination request is not the same as suspending or foregrounding; check jobs afterward to confirm the result.
When backgrounding is appropriate
- Use
command &for a task that can run without keyboard input. - Use Ctrl+Z followed by
bgwhen a command is already occupying the terminal and you decide it can continue unattended. - Use
fgbefore supplying input, responding to an interactive prompt, or otherwise controlling the program from the terminal. - Keep output and lifetime in mind: a background job can still write to your terminal, and an illustrative loop that writes the date and time to a file and sleeps for two minutes will continue until you terminate it or the session, logout, or system state ends it. That example demonstrates job control, not a production recommendation or performance measurement.
Common mistakes and recovery
Assuming Ctrl+Z keeps the command running
It does not. It suspends the job. Run bg with the correct jobspec to continue it.
Recommended Free Tools
Best Value
Using a process ID where a jobspec is expected
fg, bg, and kill can use Bash jobspecs such as %1. Get that value from jobs; do not treat it as the operating system’s process ID.
Backgrounding an interactive program
A background program that reads the controlling terminal is ordinarily stopped with SIGTTIN. Use fg to return it to the terminal, or restart it in a context designed for noninteractive operation.
Targeting the wrong job
Job numbers and current/previous markers are shell-specific and change over time. Run jobs immediately before selecting a job when several tasks are active.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.

