Changes

Jump to: navigation, search

Tutorial8: Links / Process Management

204 bytes added, 13:38, 6 March 2021
INVESTIGATION 2: MANAGING PROCESSES
# Press the following '''key combination''' to '''terminate''' the command running on the terminal: <span style="color:blue;font-family:courier;font-weight:bold">ctrl-c</span><br><br>You should notice that the process that was running in the foreground has been '''interrupted''' (i.e. terminated).<br>'''NOTE:''' The '''ctrl-c''' key combination sends '''SIGINT''' ('''Signal Interrupt''' - which is signal '''#2''') signal to<br>''terminate'' a process that is running on the terminal (i.e. the '''foreground''').<br><br>
# Reissue the Linux command: <span style="color:blue;font-family:courier;font-weight:bold">sleep 700</span><br><br>
# Press the '''key combination''': <span style="color:blue;font-family:courier;font-weight:bold">ctrl-z</span><br><br>[[Image:process-jobs1.png|thumb|right|450px|Running a command in the terminal, pressing '''ctrl-z''' to place into the background, and issuing the '''jobs''' command to view processes in the background.]]
# You should now see output similar to what is displayed below:<br><span style="font-family:courier;font-weight:bold">[1]+ Stopped sleep 700</span><br><br>'''NOTE:''' This indicates that this process has been placed into the '''background'''.<br>This is useful in order to "'''free-up'''" the terminal to run other Linux commands.<br><br>
# Issue the following Linux command: <span style="color:blue;font-family:courier;font-weight:bold">jobs</span><br><br>You should see the following output similar that was displayed above:<br><span style="font-family:courier;font-weight:bold">[1]+ Stopped sleep 700</span><br><br>This display indicates that this process (that is now in the background) has '''stopped'''.<br>In other words, the ''sleep'' command is NOT counting-down to zero to terminate.<br><br>'''NOTE:''' You need to use the '''bg''' command to '''run''' that process that was sent into the '''background'''.<br><br>
13,420
edits

Navigation menu