我试图在文件中找到一个确切的单词。这个词是 myServer ,我试图在其中找到它的文件内容是:
This is myServer and it is cool
This is myServer-test and it is cool
这是我各种尝试的结果:
grep '^myServer$' test-file.txt
grep -Fx myServer test-file.txt
--> no results
grep -w myServer test-file.txt
grep -w myServer test-file.txt
grep '\<myServer\>' test-file.txt
grep '\bmyServer\b' test-file.txt
-->
This is myServer and it is cool
This is myServer-test and it is cool
我在这里错过了一些开关吗?
非常感谢。