jobs
background and foregroundjobs shows what the current shell is running besides the command in front of you. Ctrl+Z pauses a running command; bg lets it continue in the background; fg brings it back — a way to do two things in one terminal.
Ctrl+Z, then bg moves a command you forgot to start in the background out of the way.
At the terminal
Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.
What the numbered lines are telling you
[1] is the job number in this shell and 4410 is the process id. The prompt comes straight back.
ping is paused, not ended. It is not running at all until it is resumed.
Job 2 continues, and the terminal is free for other commands.
The + marks the job that fg or bg acts on by default. "fg %1" would bring the sleep to the foreground.
Switches
A switch changes how the command behaves. These are the ones used day to day; man jobs lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.
-l- Also list each job’s process id.
-p- List only the process ids.
-r- Show running jobs only.
-s- Show stopped jobs only.
Variations worth knowing
The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.
fgBrings the most recent job back to the foreground.
kill %1Ends job number 1.
jobs -lLists jobs with their process ids.
disown %1Detaches a job from the shell, so closing the terminal does not end it.
In cybersecurity
A background job belongs to the terminal that started it.
Closing the terminal or losing the SSH connection ends its jobs. For work that must survive, use nohup, tmux or a systemd service.
A test server left running with & keeps listening after you have moved on. Check jobs and "ss -tlnp" before leaving a machine.
A job paused with Ctrl+Z still holds its files and its port. The shell warns "There are stopped jobs" when you try to exit.