Open a new terminal window
a) At the command prompt type the “top “command
b) Screenshot and post the number of running processes.
c) How many sleeping processes do you have?
d) How much total memory is shown?
e) How much swap memory is shown?
f) Describe what swap memory is and why it is important.
g) While using the top command, Press the “h” key. What happens?
Press “h” again to return.
h) What is the PID of the “top” command you issued in this
lab?
i) While using the top command, hit the “r” key to change priority.
Enter in the PID of your answer above. Does it happen
immediately?
j) Hit the “k” key to kill a process. Enter the PID of the “top”
command issued in the lab. Did it work?
If you are still in top, type exit to logout.
k) When would an administrator use the top command? How is this
useful? Is there an equivalent in Windows?
a) At the command prompt type the “top “command
b) Screenshot and post the number of running processes.
c) How many sleeping processes do you have?
194 sleeping processes
d) How much total memory is shown?
4173.2 Mib is shown.
e) How much swap memory is shown?
739.7 Mib is shown.
f) Describe what swap memory is and why it is important.
The main function of swap mwemory is to substitute disk space for RAM memory when real RAM is filled up and there is a more requirement of space.
For example, assume you have a computer system with 8GB of RAM. If you start up programs that don’t fill that RAM, everything is fine and no swapping is required. But suppose the spreadsheet you are working on grows when you add more rows, and that, plus everything else that's running, now fills all of RAM. Without swap space available, you would have to stop working on the spreadsheet until you could free up some of your limited RAM by closing down some other programs.
The kernel uses a memory management program that swaps enough of the relatively infrequently used pages of memory out to a special partition on the hard drive specifically designated for swapping. This frees up RAM and makes room for more data to be entered into your spreadsheet. Those pages of memory swapped out to the hard drive are tracked by the kernel’s memory management code and can be paged back into RAM if they are needed.
g) While using the top command, Press the “h” key. What happens? Press “h” again to return.
Help for interactive commands opens up.
h) What is the PID of the “top” command you issued in this lab?
2258 PID
i) While using the top command, hit the “r” key to change priority.
Enter in the PID of your answer above. Does it happen
immediately?
Yes, it happens immediately.
j) Hit the “k” key to kill a process. Enter the PID of the “top”
command issued in the lab. Did it work?
Yes, it worked.
If you are still in top, type exit to logout.
k) When would an administrator use the top command? How is this
useful? Is there an equivalent in Windows?
Top is a linux process that shows a list of processes running on the system and what levels of resources are being utilised. This application provides all processes running, the CPU and Memory consumed and with several switches available you can see things like the location of the executable that is running.
As a system administrator, it can be the most useful tool in your toolbox, especially if you know how to utilize it. The top utility comes pre-installed with all Linux distros.
Through this interactive command, you can customize how you can browse the list of processes, kill one, print the results to a file, and much more.
Unfortunately, they don’t make a TOP executable ported for Microsoft Windows but you can use Power Shell to script a simple TOP style display that operates just like TOP on a Linux system.
Here is the one liner you need to get a top style process viewer running on windows.
while (1) { ps | sort -desc cpu | select -first 30; sleep -seconds 2; cls }
Copy the above line and paste it in to your Power Shell console. You should see something similar to the following image.
Get Answers For Free
Most questions answered within 1 hours.