I have a question for you: I have a big log file and I want to clean it. I’m interested only in strings which contain determinate word and I want to delete the other strings. i.e.:
access ok from place1
access ko from place1
access ok from place2
access ko from place2
access ok from place3
access ko from place3
......
And I want to obtain only the ‘place2’ entry:
access ok from place2
access ko from place2
How can I do it?
Thanks in advance!
grep “place2” /path/to/log/file > cleanedFile.txt
I wrote a blog post about combining find/sed/grep – you might be interested.