Unix HW 4

docx

School

Chipola College *

*We aren’t endorsed by this school

Course

3353

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

2

Uploaded by clairemedley05

Report
COP3353 – Introduction to Unix Spring 2024 Homework 4 Due Sunday Night, February 11, 2024 ►Claire Medley◄ Questions: Lab 1 – Patch Question 1 Apply the Patch in the instructions : What did the patch add to the original file? The patch added a new line that said “Abraham Lincoln” and “1863.” Questions: Lab 2 - Grep Question 2 – Using only grep , what is the command to display the lines of jw containing the word stood Grep his jw Question 3 – What piped commands do the same as above, but using cat piped to grep . (This is sometimes called “Useless use of cat” but it’s the way the Unix creators intended). Cat jw | grep his Question 4 – Use man grep to find how to select only the lines containing matches that form whole words . List all the lines in Jabberwocky that contain the word ' in '. (Tip: Use the search feature in the man page – man uses less to display text, and less uses / as the hot-key for searching). Write only the command here: grep –w lt jw Questions: Lab 3 – File Permissions Run ls -l /home/faculty/lockwood/.plan (This is in your instructor’s directory) Question 5 – Is this a file or a directory? A file Question 6 – Look at the file permissions for /home/faculty/lockwood/.plan a. Who among our colleagues can read or write it? b. What are the file permission shown by ls -l ? c. What are the octal (numeric) file permissions shown by stat ? a. computer science faculty b. -rw-r---r-- c. 0644 Question 7 – Can you see the contents of /home/faculty/lockwood/.plan using less or
cat ? Yes Q The finger command tells you about other users' accounts on the host. - If you enter finger by itself, it tells about the users currently logged into the host. - If you enter finger followed by a user name, it tells a few details about that user. Run the command finger lockwood Note what’s displayed at the end of the output. The finger command running in your session fills in the Plan section by printing my .plan file to your screen. Question 8 – Would finger be able to print one user’s .plan file to another user’s session if the file’s owner removed permission for everyone to read it? Yes but no other user would have write permission --Tip-- This command gives everyone read permission to your own .plan file, but gives only you write permission : chmod 0644 .plan
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