COP3353_HW03

docx

School

Florida State University *

*We aren’t endorsed by this school

Course

3353

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

5

Uploaded by ProfKangarooMaster3806

Report
COP3353 – Introduction to Unix Spring 2024 Homework 3 Due Sunday Night, January 28, 2024 ►Briona Loughran Turn in: This filled-in Worksheet Lab 1: Seeing and Controlling Your Processes Questions: Lab 1a In top , kill the nano process: 1. Press k for “kill” 2. Enter nano ’s process ID and press Enter. 3. Accept the default signal 15 to instruct the program to terminate itself by pressing Enter again. Question 1 : Did nano look as if it ended normally, or did it look in an unexpected way? It looked decently normal. The window nano was in just closed out and is now waiting for a new command Run nano again in the first terminal. Kill it using top on the second terminal: Select signal 9 (the kill hammer) to instruct the kernel to remove the program’s resources. Before you kill it, write down the process id (PID). Question 2 : Did nano look as if it ended normally, or did it look in an unexpected way? It ended slightly more unexpected. The nano screen didn’t Question 3 : Did nano seem to have a chance to put itself in order before it ended? No, it just ended Cleanup : Press q to quit from top Tip: Use the clear command to remove the debris from the screen.
Questions: Lab 1b 1. In the output of ps ux in the second terminal, find the PID (Process ID) of your nano process running in the first terminal. 2. In the second terminal, use kill <pid> to terminate nano via signal 15. (Use the PID you determined above). 3. Restart nano in the first terminal. 4. Use kill -9 <pid> to terminate nano via signal 9. Question 4 : Did nano act the same as when you killed it using top ? Yes, in both circumstances it did Questions: Lab 1c 1. In the output of pgrep -a -u < username> in the second terminal, find the PID of your nano process running in the first terminal. 2. Use pkill -u <username> nano to terminate your nano process using signal 15. 3. Restart nano in the first terminal. 4. Use pkill -u <username> -9 nano to terminate nano using signal 9. Question 5 : Did nano act the same as when you killed it using the other techniques? Yes, in both circumstances it did
Questions: Lab 1d a. Use ps aux to see all the processes on the host. b. Use kill <pid> to try to terminate a process belonging to someone else. Question 6 : How did kill respond? It said operation not permitted Lab 2: Standard Streams, Redirection, and Piping Questions: Lab 2 – Redirection Enter cat test.txt to display the file on your screen. Question 7 : Copy and paste the output of cat here: January 2024 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Fri Jan 26 22:52:58 EST 2024 loughran
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Lab 3: Symbolic Links Questions: Lab 3 – Links Delete the symlink you created in the Instructions (use -i for Interactive): rm -i myJwS Question 8 : What does rm ask before it deletes the file? rm: remove symbolic link ‘myJwS’? Delete the hard link: rm -i myLinkH Question 9 : What does rm ask before it deletes this file? rm: remove regular file ‘myLinkH’? Make a symbolic link aaa to the non-existant file bbb : ln -s bbb aaa (the file is first , the link to create is second ) Run ls -l Question 10 : What color does the link have? (The color is warning you of a “broken link” – the symbolic link doesn’t point to a file). Its red letters with black highlight Continued...
Use touch bbb to create the bbb file. Run ls -l again. Question 11 : What color is the link now? Now it’s a bright cyan color (with no highlight) A symbolic link is dumb – it doesn’t care that the file it points to doesn’t exist. It also doesn't update itself if the file it points to is moved; the link just becomes a broken link. Cleanup: Delete both aaa and bbb .