jueves, 17 de agosto de 2017

grep for two words in the same file

Let's go for some more csv (or any text file) fixing, grepping and slicing and dicing.

The problem is simple:
Find a file (among a vast amount of them) that contains 2 or more words, not necessarily in the same line.

That makes piping greps onto other greps useless. The solution is quite easy, but it might not be obvious:

grep -l word1 **/*csv(.) | xargs grep -l word2 

Thanks for watching.

No hay comentarios: