搜索第二行文件并将文件名打印到标准输出

chi*_*aku 1 grep sed find awk

我有几个大约 10,000 个文件的目录。如果第二行包含特定字符串,搜索每个文件并返回文件名的最快方法是什么?

为清晰起见进行了编辑

gle*_*man 5

awk 'FNR==2 {if (/some string/) print FILENAME; nextfile}' ./*
Run Code Online (Sandbox Code Playgroud)

有些 awk 没有“nextfile”。