with SCREENSHOTS PLEASE
Linux+ Guide to Linux Certification Project 9-4 In this hands-on project, you view and manage processes using the top command-line utility. 1. On your Fedora Linux virtual machine, switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of LNXrocks!. 2. At the command prompt, type top and press Enter. 3. From the output on the terminal screen, record the following information: a. Number of processes:_________________ b.Number of processes:_________________ c. Amount of total memory (K):____________ d. Amount of total swap memory (K):____________ 4. While in the top utility, press the h key and observe the output. When finished, press the h key to return to the previous top output. 5. By observing the output under the COMMAND column on your terminal screen, identify the PID of the top command in the output and record it here: 6. Type r in the top utility to change the priority of a running process. When asked which process to change (renice), type the PID from the previous question. When asked which value to use, type 10 to lower the priority of the top process to 10. Does this new prior- ity take effect immediately? 7. Type k in the top utility to send a kill signal to a process. When asked which process, type the PID used in the previous question. When asked which signal to send, type 2 to send an INT signal. Did the top utility terminate? 8. At the command prompt, type top and press Enter. 9. By observing the output under the COMMAND column on your terminal screen, identify the PID of the top command in the output and record it here: 10. Type k in the top utility to send a kill signal to a process. When asked which process, type the PID from the previous question. When asked which signal to send, type 15 to send a TERM signal. Did the TERM signal allow top to exit cleanly? 11. At the command prompt, type clear and press Enter to clear the screen. 12. Type exit and press Enter to log out of your shell.
This question is totally based on 'top' command . It is used in linux for following purposes.
a) To find the running processes .
b) How much memory is getting used by each
process.
c) How much space is getting used and how much is
left.
d) For finding the process id(PID) of running
processes and for few more reasons.
Please find my answers below each points:
1. On your Fedora Linux virtual machine, switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of LNXrocks!.
Solution:
Press Ctrl+Alt+F2
Enter username: neeraj
Enter password: LNXrocks!
Press ENTER.
Let us say it looks something like this after getting logged in:
/home/neeraj>
Note: Please use your username. I m using 'neeraj' here as my root username is neeraj.
2. At the command prompt, type top and press Enter.
Solution:
/home/neeraj> top
Sample Output:
-------------------
top - 23:41:21 up 15:36, 2 users, load average: 0.67, 0.66,
0.49
Tasks: 276 total, 1 running, 275 sleeping,
0 stopped, 0 zombie
%Cpu(s): 3.1 us, 0.9 sy, 0.1 ni, 95.9 id, 0.0 wa, 0.0 hi, 0.0 si,
0.0 st
KiB Mem : 8089964 total, 765128 free, 5039996 used,
2284840 buff/cache
KiB Swap: 15999996 total, 15599376 free, 400620 used.
1580236 avail Mem
------------------------------------------------------------------------------------------------------------
PID USER PR NI
VIRT
RES SHR
S %CPU %MEM TIME + Command
-----------------------------------------------------------------------------
-------------------------------
2978 neeraj 20 0 2543900 542224 133332
S 5.0
6.7 28:58.83 Web
3840 neeraj 20 0 1046912 38012
22844 S
2.3 0.5
12:22.02 unity
2226 neeraj 20 0 1620448 146276 47680 S 2.0 1.8 21:08.91 java
23762 neeraj 20 0 41944 3792 3096 R 0.7 0.0 0:00.17 top
3. From the output on the terminal screen, record the following
information:
Ans.
a. Number of processes: 276.
Explanation: Line number 2 of sample commands tells total tasks which are running, stopped, sleeping etc. You can see below:
Tasks: 276 total, 1 running, 275 sleeping, 0 stopped, 0 zombie
b. Number of processes: 276:
Explanation: Line number 2 of sample commands tells total tasks which are running, stopped, sleeping etc. You can see below:
Tasks: 276 total, 1 running, 275 sleeping, 0 stopped, 0 zombie
c. Amount of total memory (K): 8089964 KB(KiloBytes)
Explanation: Line number 4 of sample commands tells total memory available, used , free, cached etc. You can see below:
KiB Mem : 8089964 total, 765128 free, 5039996 used, 2284840 buff/cache
d. Amount of total swap memory (K):15999996 KB(KiloBytes)
Explanation: Line number 5 of sample commands tells total swap memory available, used , free, cached etc. You can see below:
KiB Swap: 15999996 total, 15599376 free, 400620 used. 1580236 avail Mem
4. While in the top utility, press the h key and observe the
output. When finished, press
the h key to return to the previous top output.
Ans.
Make sure top is running. Then press h.
At the end of output you will see something like below:
( commands shown with '.' require a visible task display window
)
Press 'h' or '?' for help with Windows,
Type 'q' or <Esc> to continue : <Press Esc or type q
here>
5. By observing the output under the COMMAND column on your
terminal screen, identify
the PID of the top command in the output and record it here:
Solution. From sample output in question 2 you can see the PID(process id) of 'top' is 23762.
6. Type r in the top utility to change the priority of a running process. When asked which process to change (renice), type the PID from the previous question. When asked which value to use, type 10 to lower the priority of the top process to 10. Does this new priority take effect immediately?
Solution. Run 'top' command if not running
already. Press r. r is used to change the priority of processes
running.
It will ask for PID of the process whose
priority you want to change.
Here we want to change the priority of a
'top' process itself.
PID to renice [default pid = 2978]:
Enter the PID of top.(look at sample output in question 2. Enter
PID of top i.e. 23762).
Renice PID 23762 to value : <Enter
10>
Yes. The new priority takes effect immediately.
7. Type k in the top utility to send a kill signal to a process. When asked which process, type the PID used in the previous question. When asked which signal to send, type 2 to send an INT signal. Did the top utility terminate?
Solution:
Yes the top utility will terminate. k option is used to kill the process whose PID should be specified. By default it takes the PID of top command.
8. At the command prompt, type top and press Enter.
Solution:
/home/neeraj> top
9. By observing the output under the COMMAND column on your terminal screen, identify
the PID of the top command in the output and record it here:
Ans.
Sample Output:
-------------------
top - 23:41:21 up 15:36, 2 users, load average: 0.67, 0.66,
0.49
Tasks: 276 total, 1 running, 275 sleeping,
0 stopped, 0 zombie
%Cpu(s): 3.1 us, 0.9 sy, 0.1 ni, 95.9 id, 0.0 wa, 0.0 hi, 0.0 si,
0.0 st
KiB Mem : 8089964 total, 765128 free, 5039996 used,
2284840 buff/cache
KiB Swap: 15999996 total, 15599376 free, 400620 used.
1580236 avail Mem
------------------------------------------------------------------------------------------------------------
PID USER PR NI
VIRT
RES SHR
S %CPU %MEM TIME + Command
-----------------------------------------------------------------------------
-------------------------------
2978 neeraj 20 0 2543900 542224 133332
S 5.0
6.7 28:58.83 Web
3840 neeraj 20 0 1046912 38012
22844 S
2.3 0.5
12:22.02 unity
2226 neeraj 20 0 1620448 146276 47680 S 2.0 1.8 21:08.91 java
24678 neeraj 20 0
41944 3792
3096 R 0.7
0.0 0:00.17 top
By observing the sample output of top command provided in above
question. You can see the PID of top is 24678.
10. Type k in the top utility to send a kill signal to a process. When asked which process, type the PID from the previous question. When asked which signal to send, type 15 to send a TERM signal. Did the TERM signal allow top to exit cleanly?
Solution. Yes the top utility will terminate cleanly.
11. At the command prompt, type clear and press Enter to clear the screen.
Solution: Not needed
12. Type exit and press Enter to log out of your shell.
Solution: Not needed
with SCREENSHOTS PLEASE Linux+ Guide to Linux Certification Project 9-4 In this hands-on project, you view...
On your Fedora Linux virtual machine, switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of LNXrocks!. At the command prompt, type sleep 6000 and press Enter to start the sleep com- mand, which waits 6000 seconds in the foreground. Do you get your prompt back after you enter this command? Why? Send the process an INT signal by typing theCtrl+c key combination. At the...
On your Fedora Linux virtual machine, switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of LNXrocks!. At the command prompt, type ps –ef | grep bash and press Enter to view the bash shells that are running in memory on your computer. Record the PID of the bash shell running in your terminal (tty2): . At the command prompt, type kill –l and press...
Project 4-4 In this hands-on project, you make and view links to files and directories.Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.At the command prompt, type cd samples and press Enter. Next, type ls -F at the command prompt and press Enter. What files do you see? Next, type ls -l at the command prompt and press Enter. What is the link...
2. At the command prompt, type ls –l /dev/log and press Enter. What is the file type? Which daemon on Ubuntu Server Linux uses this file and what is its purpose? 3. At the command prompt, type less /etc/rsyslog.conf and press Enter to view the configuration file for the System Log Daemon. Are there any entries that specify facilities, priorities, or log file locations? What does the last line of the file specify? Press q when finished to quit the...
Process Management in Linux 4) Control jobs for multi-tasking a) Create some jobs a) Create some jobs i) Type “cat” command in the terminal, and press ctrl-c to terminate it. Type “jobs” command and you will see nothing. ii) Type “cat” command in the terminal, and press ctrl-z to stop it (suspend it). Use “jobs” command and what do you see? iii) Execute some command in the background using the &, for example: nano & iv) Execute another command (for...
I need screenshots of every step please Case Projects Case Project 7-1: Use SSH in Ubuntu In this project, you learn to use SSH in Ubuntu. Using the Ubuntu VMs you created in the case projects in Chapters 2 and 3, follow the steps to use SSH. Using the VM that has Ubuntu Server installed, do the following: 1. Start the VM and log on 2. SSH is included in Ubuntu Server but is not installed. Enter this command to...
You are currently running/debugging a shell script program in the foreground that seems to be in an infinite loop, to terminate/kill the shell script program. 7. (type/enter - control C to send a "program interrupt" ) or (contact the sysadmin person to kill your shell script program) 8. The UNIX/Linux exit command entered on the KORN shell command line will exit the shell session properly (best practice). [True / False] When killing a background process with the kill command you...
Project 4-3: In the following steps, you will learn more about the PING (Packet Internet Grouper) utility, which can be used on a network running IPv4 to verify that TCP/IP is configured correctly and communicating with the network. A ping test is typically the first thing network professionals try when troubleshooting a TCP/IP connection problem. For this project, you can use any type of workstation that's running TCP/IPv4, preferably one connected to the Internet. The output described in the following...
This will be done using Python in Linux Mint. The program should include a comment block at the top with your name, the program number, and the name of the course. (Make sure to have the file that does have the extension .py) How to run the file in Linux Mint? Open a command prompt (e.g. terminal) Make sure you are in the directory where your file is saved (e.g. type "cd ~/Desktop" if your file is on...
This is for a Unix class. Please help me out. I am attaching a skeletal code of the program below, it just needs ti be filled in. Below is a skeletal code of the program. Fork a child process and then use the parent for reading and the child for writing. This is just a way of sending and receiving messages asynchronously. /* ************************************************************* * Utility functions * ************************************************************** */ static void usageError(const char * progName, const char *msg) {...