Consider that after grep
, awk
and grep
again I have a list of line numbers looking like this:
20
55
98
154
1100
...
The command I'm using looks like this:
grep '01/01' /var/log/some.log | grep 'some' | awk '{print $10}' | grep -vn 200 | awk -F ':' '{print $1}'
I would like to now print those lines from that file, ideally by continue to pipe this command. Any ideas?
I know I could simply remove awk '{print $10}'
and awk -F ':' '{print $1}'
but for some reason when I do this I get no results, whereas when I try with the command posted above I do get the list of numbers.
200
somewhere else on all the lines that contain both01/01
andsome
, so yourgrep -vn 200
filters out all of them and not just those that have200
in the 10th field.