dillian_pruitt_Ch8Lab

docx

School

Tulsa Community College *

*We aren’t endorsed by this school

Course

2143

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

3

Uploaded by CaptainAntelopeMaster953

Report
Ch 8—Searching, Extracting, and Archiving Data Lab Exercises Answer Template This lab must be performed on a Fedora virtual machine (or physical machine). Using grep, find, and regular expressions in Fedora (Objective 3.2) 4. Take a screen shot of the results and paste them here: 5. Type man grep . Press space bar once. What will the -i option do? Ignore case distinctiuon in patterns and input, data so that character that differ only in case match eatch other 7. How many additional instances of hostname were found by ignoring case? 5 11. Use arrows to scroll up and down through the passwd file. Screen shot your regular user account: 13. Type grep open /etc/passwd Open is salmon colored. How many instances of open were found? 5
14. Type grep ^open /etc/passwd to display only those files with “open” at the beginning. Screen shot: 15. Type grep bash$ /etc/passwd. What do think the $ character does in this application? The $ anchors the search to the of the line and will find lines in /etc/passwd that end with bash 16. To find your username or root, type grep -E “( Username |root)” /etc/passwd Enter your username instead of Username . The -E option indicates that you are using an extended regular expression. How many entries were found? 5 17. Now, you will search for information about files. wc shows line count, word count, and byte count. Type wc /etc/hosts . Now cat /etc/hosts . Were the results of the wc command accurate? yes 18. How many lines are in the /etc/passwd file? 47 21. Use the up arrow and append: find /usr/share/doc/ -name COPYING | wc . Note: the | pipe symbol is located on the \ key. In the same manner, pipe the output of the other command to wc Which command found more files named COPYING ? WC
Redirection and Pipes (Objective 3.2) 4. Redirect STDOUT to a file by typing echo "Hello" > new_file . What was displayed? Nothing 7. Type echo "I am redirected" > new_file . Now type cat new_file . Was the new data appended to the old data, or did it overwrite it? Overwrote it Compression and Archiving (Objective 3.1) 10. What is the name of the new file? What color is it? 13. What is the name of your tarball? 16. What color is the new directory? 18. What command did you use? 21. What does the x (instead of c) do? 22. Do you see the 4 .log files, the tarball file, or all of the above?
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