Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Check My WorkCheck My Work Log in to the GNOME desktop on your Fedora 20 system

ID: 3889804 • Letter: C

Question

Check My WorkCheck My Work

Log in to the GNOME desktop on your Fedora 20 system as user1 and open a commandline terminal. At a shell prompt, type xeyes to execute the xeyes program. Does the terminal window stay open? Click the terminal window to bring it to the foreground. Do you see your shell prompt? Why? Close your terminal window by clicking the X symbol in the upper-right corner. What happened to the xeyes program? Why?

Next, open another command-line terminal and type xeyes& at the command prompt to execute the xeyes program in the background. Click the terminal window to bring it to the foreground. Do you see your shell prompt? Why? Close your terminal window by clicking the X symbol in the upper-right corner. What happened to the xeyes program? Why?

Finally, open another command-line terminal and type nohup xeyes& at the command prompt to execute the xeyes program in the background from the nohup command. Click the terminal window to bring it to the foreground and press Enter. Do you see your shell prompt? Why? Close your terminal window by clicking the X symbol in the upper-right corner. Notice that the xeyes program is still available. Research the nohup manual page and explain why.

Explanation / Answer

Yes, the terminal window stays open even after we launch xeyes. No, we do not see the shell prompt. This is because xeyes was launched using the terminal and the process needs to be killed before another command or process is used. The xeyes program closes on hitting the close button as it was running on the terminal and cosing the terminal kills the process.

Using xeyes& makes the process run in the foreground but the shell prompt becomes visible again. We can now use different commands while the process i sstill being run. Closing the terminal window closes the xeyes program as the process is killed when terminal is closed.

Using nohup xeyes& makes the program run in the background relative to the shell so it does not kill the process even after closing the terminal window.