linux-tutorial/codes/shell/查找替换文本/grep.sh

9 lines
177 B
Bash
Raw Normal View History

2019-11-22 13:36:55 +08:00
#!/usr/bin/env bash
# 使用 grep 命令可以用于在文件中查找指定文本
# 在二进制文件中查找字符串
file=$1
keyword=$2
strings ${file} | grep ${keyword}