COMPUTER SCIENCE AND ENGINEERING
UNIX
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
“grep-v” command is used to
|
Multiple Choice
|
|
displays all lines except lines mathcing pattern while filtering
|
|
Displays all line while filtering
|
|
none of these
|
Explanation:
Detailed explanation-1: -Similarly, by using grep-v you can list down all files which don’t contain a word I mean excluding files which match a pattern, grep-c will print the count of matching pattern in a file, etc. One of the popular examples of the grep command is to find empty files and directories in Unix.
Detailed explanation-2: -The most simple way to exclude lines with a string or syntax match is by using grep and the-v flag. The output will be the example. txt text file but excluding any line that contains a string match with “ThisWord”. Use whichever works best for your particular workflow.
Detailed explanation-3: –n: displays the lines containing the pattern along with the line numbers.
There is 1 question to complete.