相关疑难解决方法(0)

使用grep仅提取整个单词

我有一个大文本文件.我需要提取包含确切单词"DUSP1"的所有行.这里有一个例子:

9606    ENSP00000239223 DUSP1   BLAST
9606    ENSP00000239223 DUSP1-001 Ensembl
Run Code Online (Sandbox Code Playgroud)

我想要检索第一行而不是第二行.

我尝试了几个命令:

grep -E "^DUSP1"
grep '\<DUSP1\>'
grep '^DUSP1$'
grep -w DUSP1
Run Code Online (Sandbox Code Playgroud)

但它们似乎都不起作用.我应该使用哪个选项?

regex grep match exact-match

17
推荐指数
2
解决办法
3万
查看次数

标签 统计

exact-match ×1

grep ×1

match ×1

regex ×1