Job Control
Published on 07 Jun 2004Tags #Bash
Bash’s job control facilities:
-
Running a foreground process:
sleep 10
-
Running a background process:
sleep 10 &
-
Suspending a foreground process:
^z
-
Listing jobs:
jobs
(This command lists suspended and background jobs with their respective job numbers.) -
Resuming a suspended process in the foreground:
fg N
(where N is a job number taken from the job listing) -
Resuming a suspended process in the background:
bg N
(where N is a job number taken from the job listing) -
Pulling a background process to the foreground:
fg N
(where N is a job number taken from the job listing) -
Pushing a foreground process to the background:
-
Suspend the foreground process.
-
Resume a suspended process in the background.
-
-
Terminating a job:
kill %N
(where N is a job number taken from the job listing)