首页 > 解决方案 > from a list of binaries print the one that includes a specific ascii string

问题描述

I have a folder with some binaries.

What I want to do is to print all the files that include a specific ascii string.

With the following commands

strings * | grep <string> 

I can check that at least, somewhere the string exists, but how I can get the specific binary?

Thanks and happy new year!

标签: linuxgrep

解决方案


With gnu grep (the one you find e.g. in linux):

grep -aH <string> *

If you want to suppress the ugly output and only keep the files that do match:

grep -al <string> *

推荐阅读