Question

In: Computer Science

Linux Commands 8.How would you find out information about systemdon your Linux workstation? 9.A user would...

Linux Commands

8.How would you find out information about systemdon your Linux workstation?

9.A user would like to put the firefoxprogram in the background –what would you type into the command prompt to do this?

10.For the program in above, how would you bring it back into the foreground?

11.What is the fork()function call?

12.In Linux what command sequence do we enter to stop a program?

13.What is the UIDcolumn in the output of the command ps -ef?

14.What is a PIDand PPID? What is the relationship? Show an example from the process table.

15.What are signals, how can they be used?

16.A process has a PIDof 6789, what command would you enter at the terminal toterminatethe process?

17.How can you kill a processes run by the user tim? Why can’t a normal user kill another users processes?

18.What is the /procfile system used for?

19.For a given process run the fuserand lsof commands? What can you learn about a process using these commands?

20.A user wants to start a program every 5 minutes–what would you do to facilitate this ?

Solutions

Expert Solution

8. Use systemctl status

9. Use

nohup firefoxprogram &

10. Use
    jobs
and then use fg <job_id> to bring it to foreground


11. The purpose of fork() is to create a child process of the caller process.
Hence you can create subprocess using fork()

12. We use Ctrl + C to stop a process.

13. The UID in the ps -ef output refers to the owner of the process.

14. PID is the process id of the process and PPID is the process id of the parent process for the running process

Here, the process with PID 96 has a PPID 1 which means process with PID 1 is the parent process of process with PID 96

15. Signals are event generated by some processes triggered by specific conditions.
They can be used to communicate with other processes or child processes to trigger another event on the timeline.

16. Use kill 6789

17. Use su - tim && kill -9 <PID>, the -9 is used to instruct kill the process started by another user.
It is not possible for normal users to kill another process started by different user to make sure there is autonomity in a system and also for security reason as to prevent another users to interfere with other user's work.

18. The /proc file is the control and information centre of the kernel, it is created dynamically at the time of boot up and dissolved at the time of shutdown. It contains information about all the processes started and running.

19.

Using fuser we can find which process is using a directory, file or socket/port.
Using lsof we can find which files are opened. Stands foe list of open files. Indirectly can help to see which files are currently used by processes

20. You can write a shell script for the program or use the watch command:

watch -n 300 <program_name> sync

300 specifies time in seconds, sync takes care of the output being shown and cleared


Related Solutions

What would these commands look like in Kali Linux? In Kali Linux: a) Create a user...
What would these commands look like in Kali Linux? In Kali Linux: a) Create a user (username= YOUR-FIRSTNAME). b) Create a file (filename=test) and use chmod command to add the write permission for Others. c) Use setfacl to remove write permission to YOUR-FIRSTNAME user. Use getfacl to check the file's permissions. d) Remove YOUR-FIRSTNAME user. Deliverable(Screenshots from each section if possible please)
Try the Linux commands listed below. Post your thoughts about how to use these commands. Discuss...
Try the Linux commands listed below. Post your thoughts about how to use these commands. Discuss options that you might use with them, compare and contrast them and/or ask questions about commands you are not sure about. mount and umount more and less head and tail grep kill / xkill / pkill / killall su and sudo man and whatis ping and traceroute
Create a C program that has a sequence of at least 8 linux commands you would...
Create a C program that has a sequence of at least 8 linux commands you would execute to display what each command does. Explain what each command is doing and show the output of them.
Linux Question: Describe how you created above file and its contents in VI. a) Bash/VI commands:...
Linux Question: Describe how you created above file and its contents in VI. a) Bash/VI commands: 20pts; b) Non-brute-force solution: 10pts). Note: Brute-force solution means that entering characters one by one Install JDK 1.8 by the following command: $ sudo dnf –y install java-1.8.0-openjdk-devel.x86_64 Use VI to create a file “YourFirstNameHomework.java” (e.g., “MollyHomework.java”) and add the following contents into it. (grading details: file name format:10 pts, a screenshot of the file content in the VI environment: 10pts, paragraphs: 10pts, empty...
Discusses how you would find out how to keep an outfielder on a baseball team if...
Discusses how you would find out how to keep an outfielder on a baseball team if you had to cut two players of three. The averages of the three players are: Player 1: 333, Player 2: 301, Player 3: 296. Player one hit 6 home runs, player 2 hit 4 home runs, and player three hit 16 home runs. Which statistic is a better evaluation of player performance why? How did you determine this by statistical testing?
discuss how you would find out how to keep an outfielder on a baseball team if...
discuss how you would find out how to keep an outfielder on a baseball team if you had to cut two players of three. The averages of the three players are: Player 1: 333, Player 2: 301, Player 3: 296. Player one hit 6 home runs, player 2 hit 4 home runs, and player three hit 16 home runs. Which statistic is a better evaluation of player performance why? How did you determine this by statistical testing? Minimum paragraph count...
You would like to purchase a home and are interested to find out how much you...
You would like to purchase a home and are interested to find out how much you can borrow. When your lender calculates your debt to income ratio, he determines that your maximum monthly payment can be no more than $4,349. You would like to have a 30 year fully- amortizing loan and the interest rate offered on such a loan is currently 3%. Given these constraints, what is the largest loan you can obtain? Round your answer to the nearest...
From recent outbreaks (minimum 3), find out how the information about the outbreak and the risk,...
From recent outbreaks (minimum 3), find out how the information about the outbreak and the risk, protection, and other important public health information was disseminated to the public. Include: How long did it take to get out to the public? What media did the public health service and/or WHO use to disseminate? What was the public reaction?
You would like to evaluate TSLA's stock. You find out the following about TSLA needed to...
You would like to evaluate TSLA's stock. You find out the following about TSLA needed to do so: (1) Their CAPM beta is 1.6. (2) The weighted-average YTM on TSLA's bonds is 4%. (3) Tesla's effective tax-rate is 25%. (4) TSLA's capital structure mix is 96% equity and only 4% debt. TSLA has 932 million shares outstanding. (5) The risk-free rate is currently .5% and the market risk-premium is 6%. (6) Below are TSLA's expected OCFs (operating cash flows) for...
You would like to evaluate TSLA's stock. You find out the following about TSLA needed to...
You would like to evaluate TSLA's stock. You find out the following about TSLA needed to do so: (1) Their CAPM beta is 1.6. (2) The weighted-average YTM on TSLA's bonds is 4%. (3) Tesla's effective tax-rate is 25%. (4) TSLA's capital structure mix is 96% equity and only 4% debt. TSLA has 932 million shares outstanding. (5) The risk-free rate is currently .5% and the market risk-premium is 6%. (6) Below are TSLA's expected OCFs (operating cash flows) for...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT