Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Open a terminal window and login to Student user profile. 1. Here, we shift to examining running processes in our terminal window. Open a second

Open a terminal window and login to Student user profile.

1. Here, we shift to examining running processes in our terminal window.

Open a second terminal window by typing gnome-terminal. Notice that both

windows are equally accessible. To close a terminal, type exit or control+d, or click on the X in the upper right hand corner or select Close TerminalfromtheFilemenu. Closethesecondwindow(leavethefirst window open). Another type of window is called an xterm. Type xterm. [If xterm doesnt exist in your bash, you need to install it first. Check the xterm installprocessgivenbelow]Returntoyouroriginalterminalwindow. What happens when you attempt to use that terminal window? Close the xterm window (exit or control-d). Can you access your original terminal window? Follow the process of installing xterm: su password: yum install xterm [If you get the message that another app is currently holding the yum lock, then you need to run 2 extra commands before yum install command: systemctl stop packagekit systemctl disable packagekit yum install xterm

Then exit root.

Again, open an xterm window. In your original window, type control+z. This suspends the current running process (xterm). What message do you receive in your original window? Attempt to use the xterm window. What happens?

In your original terminal window, type jobs which shows you the running or stopped processes launched from that window. Type man jobs. While the man page is listed, type control+z to suspend this as well. Type top and once it starts to run, type control+z to suspend it (we will examine top later in this lab). Type jobs. What is displayed? To resume any of these jobs, type fg # where # is the job number as shown in the jobs listing(This is not the PID). The command fg without a number will resume the job that has a + next to it (the most recently run job). Resume the man job. How did you do this? Type q to exit man. Type jobs. What is displayed now? Type fg 1 to resume xterm. Type control+z to suspend it again. Type jobs. Which job now has the +? The indicates the second most active job. Type fg. Which job resumed? Type control+c, which will exit this job. What happened? Type fg. What job resumed? Type q to quit this program. Type jobs, you should see nothing.

We can launch it into the background by adding & after the instruction which will free your terminal window. Type xterm &. How does this differ from entering xterm without &? Inthextermwindowtypemanxtermandreadaboutxterms(ifdesired). Returntoyour original terminal window and type find ~ -empty &. The find process ends, but you do not receive a prompt. Hit . What is displayed?

With one xterm still running, in your original terminal window type xterm to start a second xterm and control+z to suspend it. Type jobs. How do the two listings of the xterm jobs differ from each other? Type fg to resume the stopped xterm job and exit out of xterm. Type jobs again. What do the words Running and Stopped mean in the jobs output? Exit any remaining xterm windows. In your original window, type jobs again. What is output?

From the Applications menu, start a couple of GUI processes (for instance, Text Editor, Calculator). In your terminal window, type jobs. What is displayed? Why do you not see information on the two GUI processes? Close your GUI processes.

In your terminal window, type xterm, man jobs and top control+z to suspend each (do not use &). Type jobs, all three should be listed as stopped. Type bg xterm. What happens? Type jobs. Has xterms status changed? If so, how? The bg command moves a process into the background to continue running. Notice xterms status is listed as xterm &, we can access it at the same time as our terminal window. Exit xterm, resume and exit each of man and top.

2. Monitoring processes

Type top. Notice that the display stays in the window but changes every few seconds.

What is the %CPU usage of top? Leave top running, and in a second terminal window launch the command find / -empty (ignore any messages that you receive while it is running). While find executes, look for find in tops display. It moves around. Why is it moving? As it moves, what happens to its %CPU and %MEM values? After perhaps 30 seconds or a minute, find will end. Examine top. What happens to the find entry?

Another process listed in top is init with a PID of 1. Why does init have a PID of 1?

Start the GUI System Monitor program by selecting Applications -> System Tools->SystemMonitor. ClickontheProcessestab. Comparethistowhat you see in top. Compare the fields available in the System Monitor to those available in top. What fields differ (if any)? Close this preferences window. Click on the Resources tab. Compare the information about CPU usage, memory and swap history as shown in the GUI to what top tells you. You can close the system monitor now (leave top running).

You interact with top by entering letters which are commands. Type u to change users and when prompted, enter Student. What are the top processes listed for Student?[Attach a screenshot] What is the smallest PID and the largest PID that you see in the top window? Type u and to reset top to showing all users. Type d to change the refresh duration from the default (3 seconds) and type 0.5 . Notice how quickly top changes. You should see the top process change quickly. Type d 3 to reset

it. Type q to exit top.

Priorities a. In one terminal window, type top. In the other window, su to root and then type nice

n -20 find / -empty. Watch finds progress in top. What are its priority and NI

(nice) values? Exit as root. b. Make a note of tops PID. In the other window, type renice n 10 p PID where

PID is tops PID. What response did you get?

Killing processes

Open an xterm in the background (xterm &). Type ps u to obtain the PID of xterm.

Enter the command kill s 9 PID where PID is the PID of xterm. What happens? (look at your other terminal window, does your prompt appear? If so, where is it?)? Restart xterm, obtain its PID and kill it using s 1. What happens? Increase the signal until the xterm ends. What signal is needed to kill it? Why did s 9 kill it but not 1?

The killall command can be used to kill multiple processes. Launch two xterm & processes. Enter the command killall xterm. What happens? Open two more xterm &processes. Typekillallixterm. Whatisthedifference?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

3. Use personal best goals, not between-student competition.

Answered: 1 week ago

Question

Identify the federal laws affecting equal employment opportunity.

Answered: 1 week ago

Question

Identify the elements of the dynamic HRM environment.

Answered: 1 week ago

Question

Discuss attempts at legislating ethics.

Answered: 1 week ago