I want to find all the lines in my text file containing the string "abc", but not containing the string "def". Can I use the grep command to accomplish this task?
I want to find all the lines in my text file containing the string
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Either of the these will do:
or
The following will also preserve coloring if you only want to see the output on stdout:
The
-voption (stands for “invert match”) tellsgrepto ignore the lines with the specified pattern – in this casedef.