linux - 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!
解决方案
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> *
推荐阅读
- javascript - PHP vars that have been updated after POST and echoed to JS remain null
- json - Label elements based on class they belong to
- c# - IDisposable 和 Task.WaitAll 自行等待
- angular - 类型推断并不总是适用于 Angular Material 的 MatSelect
- python - 如何在 BeautifulSoup 中提取包含普通文本以及其他 HTML 标签的内容?
- javascript - 在 2d Array Javascript 中查找零索引数据
- python - Python - 在返回语句中使用方法
- python - 使用来自 pytest 的 AdWordsClient 时出错 - 检测到递归(相同的本地人和位置)
- c++ - 使用标志 KMEANS_USE_INITIAL_LABELS 时是否有/如何解决 OpenCV C++ kmeans() 中的这个错误?
- spring - 具有安全默认登录成功重定向问题的 Spring Boot