我有一个以下文件
cat test.txt
/mount/u001/oracle/product/12.1.0.2 41004360
/mount/u001/oracle 7186360
我只想准确地说#34; / 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
答案 0 :(得分:0)
grep "^\/mount/u001/oracle$" test.txt