regex - grep first n rows, return file name only -


i can following search need , return file name: grep -l "mysearchstring" ./*.xml files searching huge takes forever. string searching appear in first 200 rows how can search first 200 rows , still return file name?

you can do:

for file in *.xml;    head -200 "$file" | grep -q "mysearchstring" && echo "$file" done 

Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -