A report export takes ten minutes, and meanwhile you need the terminal for other work. Start a long command and see how the shell responds.
A long command and the prompt
Run the three commands in order. sleep 600 does nothing for ten minutes and stands in for a long export, and the & at the end of the line is the new thing to watch.
First, predict
When will the prompt come back after sleep 600 &?
Now start the exercise, run the command and compare your prediction with the output.
The prompt is back. What is going on with sleep 600 now?
-
Ten minutes have not passed yet:
jobsshowsRunning sleep 600 &, andpsshows a sleep 600 row. -
The command has already started:
psshows a sleep 600 process with the PID the shell printed after[1]. -
jobswould show a pause as Stopped. For sleep 600 it shows Running.
sleep 600 is running: jobs shows it as Running, and ps as a process with the same PID.