【发布时间】:2018-03-08 04:54:34
【问题描述】:
我有一个下面的文件
cat test.txt
/mount/u001/oracle/product/12.1.0.2 41004360
/mount/u001/oracle 7186360
我只想准确地grep“/mount/u001/oracle”
grep -w "/mount/u001/oracle" test.txt 给出
/mount/u001/oracle/product/12.1.0.2 41004360
/mount/u001/oracle 7186360
grep "\b/mount/u001/oracle\b" test.txt -- no result
grep "^\/mount/u001/oracle\$" test.txt -- no result
【问题讨论】:
-
@all : 我们有一些生产问题需要解决
-
试试
grep '^/mount/u001/oracle '或grep '^/mount/u001/oracle[[:blank:]]' -
嗨 Sundeep:对不起,它没有给出任何结果/输出..感谢您的努力