grep - 如何使用 grep 在平面文件数据库的字段中查找特定单词?

标签 grep

我需要这个 grep 调用:

grep "field3=highland" data_file

返回“field3=highland”和“field3=chicago highland”的结果。 如何重新设计 grep 调用以适应这两种情况?

最佳答案

您可以使用 * 通配符

grep "field3=.*highland" data_file

关于grep - 如何使用 grep 在平面文件数据库的字段中查找特定单词?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1449934/

相关文章:

awk - 在文件中搜索 3+ 连续行匹配条件

c# - 在多个文件中搜索多个字符串的 Grep 工具

regex - 使用 grep 从 ifconfig 输出的一行中提取 IP 地址

regex - Grep(或者可能是正则表达式)在匹配之前或之后检查行上的模式

Linux 命令管道 : using iwlist with grep to display two piece of information

html - Grep 包含 HTML 和空格的文件中的单词列表

regex - Grep 每行中第一次出现的位置

linux - 使用具有模式映射的外部文件替换模式后的行

linux - 转义反斜杠后出现 Grep 问题

php - grep 搜索模式中的 "-"