Whenever i write grep -v "0" in order to ignore the 0 number somehow
the number 10 is getting ignored as well.
Please help me use the grep -v “0” with ignoring 0 in the process and not ignoring 10
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.
So, grep works on a line-by-line basis. If something in the line matches, it matches the line. Since you’ve said to invert the set of matches (-v), it doesn’t show anything containing a 0 in the line, which 10 contains.
If you just have line-by-line output like
and you just want to ignore anything that is solely ‘0’,
you can do something like
grep -v “^0$”
I created a file containing some numbers
then ran the grep.
Is that what you want?