Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.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
如何在bash中找到特定的模式_Bash_Awk - Fatal编程技术网

如何在bash中找到特定的模式

如何在bash中找到特定的模式,bash,awk,Bash,Awk,我想在一个文件中找到一个模式'@s241',它很容易使用: grep '@s241' file 或 但问题是该文件包含诸如@s2470或@s2478之类的模式 我如何指定没有扩展名的确切模式为@s247 谢谢在grep中使用-w grep -w '@s247' file 或 或 在grep中使用-w grep -w '@s247' file 或 或 在grep中使用-w grep -w '@s247' file 或 或 在grep中使用-w grep -w '@s247' file 或

我想在一个文件中找到一个模式
'@s241'
,它很容易使用:

grep '@s241' file

但问题是该文件包含诸如@s2470或@s2478之类的模式

我如何指定没有扩展名的确切模式为@s247


谢谢

在grep中使用
-w

grep -w '@s247' file


在grep中使用
-w

grep -w '@s247' file


在grep中使用
-w

grep -w '@s247' file


在grep中使用
-w

grep -w '@s247' file