November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Job Control

View the currently running jobs:
jobs

Place running foreground process into background:
ctl-z #puts the job to sleep
bg %1

Bring a background job into the foreground:
fg %1

Kill a job:
kill %1
kill %1 -9

Find the PID of all jobs
jobs -p
jobs -pl

Bring a nohuped process to the foreground
# note: I think you can only do this from the same terminal session.
# It doesn’t look like it is possible to nohup a process, close a terminal
# and then bring the process back to the foreground again. Use screen instead.

# If you do not close your terminal session and if you do something like
nohup sleep 100 &
# and want to bring this to the foreground
# find the process ID using
jobs -p
or
ps -ef
# then supply the PID as the argument to the fg command
fg 14389420

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>