Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 在grep搜索中使用literal$_Linux_Grep - Fatal编程技术网

Linux 在grep搜索中使用literal$

Linux 在grep搜索中使用literal$,linux,grep,Linux,Grep,我试图使用literal$作为使用grep的搜索的结束锚。整个问题是在文件中搜索以At开头、以literal$结尾的行。我已经尝试了代码的几种变体,我认为它们会起作用,但不会得到任何结果,即使应该有。 grep'\'test.txt 任何建议都将不胜感激,我是Linux的一年级学生,所以如果我遗漏了一些简单的东西,请原谅我。谢谢你grep'\'test.txt grep '\<At[a-zA-z]\{1,\}[$]\>' test.txt 为了避免玩shell转义游戏,请将$放在

我试图使用literal$作为使用grep的搜索的结束锚。整个问题是在文件中搜索以At开头、以literal$结尾的行。我已经尝试了代码的几种变体,我认为它们会起作用,但不会得到任何结果,即使应该有。
grep'\'test.txt

任何建议都将不胜感激,我是Linux的一年级学生,所以如果我遗漏了一些简单的东西,请原谅我。谢谢你

grep'\'test.txt
grep '\<At[a-zA-z]\{1,\}[$]\>' test.txt

为了避免玩shell转义游戏,请将$放在角色类中。

太棒了,我让它工作了,但我对它做了一些修改,以便在At和$之间选择不使用角色。格雷普\