例如,我输入的乳清:
grep Eth test.sh
我会得到
Summary: Ethernet settings tool for PCI ethernet cards
假设我只需要搜索到的模式并排除前面的所有单词
Ethernet settings tool for PCI ethernet cards
我如何在 grep 中执行此操作?
最佳答案
使用 GNU grep:
grep -Po '\KEth.*' test.sh
输出:
Ethernet settings tool for PCI ethernet cards
关于Linux - grep 排除前面搜索模式中的所有单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37866530/