linux - bash: check if multiple files in a directory contain strings from a list -


folks,

i have text file contains multiple lines 1 string per line :

str1 str2 str3 

etc..

i read every line of file , search strings inside multiple files located in different directory.

i not quite sure how proceed.

thanks help.

awk 'nr==fnr{a[$0];next} { (word in a) if ($0 ~ word) print filename, $0 }' fileofwords /wherever/dir/* 

Comments

Popular posts from this blog

Using 'OR' and 'AND' in SQL Server -

python - Finding intersection between ellipse and a line -

c++ - NetBeans Remote Development with additional configuration -