I have been struggling to answer these questions and would really appreciate hel
ID: 3750109 • Letter: I
Question
I have been struggling to answer these questions and would really appreciate help to answer them. Thank you!
Question #6: What does "grep" do? Shows only the last few lines of output. ORe-arranges input lines. Individually edits cach line of input. Breaks up lots of output into page-size chunks Shows only the first few lines of output. Transforms input characters before passing them to output. Selects sone lines from the input to pass to the output Question #7: what does the notation "foo(1)" mean? When you type this, the system runs version(1) of the 'foo" program. None of the other answers is correct. Information about "foo" can be found by running "man s 1 foo Run "foo" once:; "foo(2)" would run the progra again its own output Command "foo" requires its arguments be in parentheses. Question #8: I want a list of all words more than 4 characters long. What command will work? Cannot be done grep- None of the other answers is correct. grep uar/ahare/dict/worda s fuar/ahare/dict/worda usr/share/diat/words Ogrep. Ogrep -* '.. . . /uar/ahareidiet/worda Question *9: Which flag to grep causes it to search for whole words? 0-1 ONo flag ncoded; this is the default behavior uestion #10: Each student's answers for an on-line quiz are saved in a file along with the word Ogrep -n pass I wc -l pass or fall How would I find out how many quizzes were passed, if I ere in the directory where the answer are stored? Ogrep -c pass' I wc -1 ONone of the other answers is correct. grep pass wc 1 OCannot be done. Osed's/pass.- Iwe -1 Ogrep -c pass* Ogrep -I pass* Ogrep -1 passwc-I Question #11: I have a program that gives output in the form "name: date: i ·TIere are no spaces in the information. I want only name: information", with the dates removed. which command will work? Cannot be done grep.* ' rep'.* None of the other answers is correct.Explanation / Answer
(6) grep command is used to find the match a specific expression in a patricular input or file and returns the matched lines.
eg: grep "lion" wordlist.txt
Here grep will display all the line in wordlist.txt which have a matching word "lion" in it
Ans: Select some line from input to pass to the output
(8) Assumption: If the words are in a file wordlist.txt and each word is in new line as follows
wordlist.txt file
------------------
one
two
three
four
we can use a grep command like grep "....." wordlist.txt to find the words in wordlist.txt which is more than 4 letter. Each dot inside the " " is equal to a character. so we need to put 5 dots inside double quotes such that more than 4 character words will be matched by the grep
Ans: grep "....." /usr/share/dict/words
(9) By default grep will match for a pattern or string even if it is in the substring of a word in given input or file. To make grep seach for whole word match we need to use -w option
Ans: -w
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.