![]() | Red Hat Certified System Administration 8 |
Exercise 01: Managing jobsIn this exercise, you apply the commands that you just learned about to manage jobs that have been started from the current shell. 1. Open a root shell and type the following commands:sleep 3600 & dd if=/dev/zero of=/dev/null & sleep 7200 2. Because you started the last command with no & after the command, you have to wait 2 hours before you get control to the shell back. Type Ctrl+Z to stop it. 3. Type jobs . You will see the three jobs that you just started. The first two of them have the Running state, and the last job currently is in the Stopped state. 4. Type bg 3 to continue running job 3 in the background. Notice that because it was started as the last job, you did not really have to add the number 3. 5. Type fg 1 to move job 1 to the foreground. 6. Type Ctrl+C to cancel job number 1 and use jobs to confirm that it is now gone. 7. Use the same approach to cancel jobs 2 and 3 also. 8. Open a second terminal on your server. 9. From that second terminal, type dd if=/dev/zero of=/dev/null & . 10. Type exit to close the second terminal. 11. From the other terminal, start top . You will see that the dd job is still running. From top, use k to kill the dd job. |