/usr/local/bin にある #!/usr/bin/python3 をみつけたい、場面です。 こんな感じ。 find /usr/local/bin -type file | xargs awk '/python3/ {print FILENAME} {nextfile}' 1行目だけ検査したらさっさと nextfile で次に移るので OK というわけ。 nextfile Stop processing the current input file. The next input record read comes from the next input file. FILENAME and ARGIND are updated, FNR is reset to 1, and processing starts over with the first pattern in the