简体   繁体   English

为什么“ grep * q1 *”不匹配任何内容?

[英]Why doesn't “grep *q1*” match anything?

I have a list of files using: 我有使用以下文件的列表:

$git show commit:.data/path/to/file/

abc-2018-q1.csv
def-2019-q2.csv
the-2019-q1.csv

I am trying to do $git show commit:.data/path/to/file/ | grep *q1* 我试图做$git show commit:.data/path/to/file/ | grep *q1* $git show commit:.data/path/to/file/ | grep *q1*

ie select only those files whose names contain "q1". 即,仅选择名称包含“ q1”的文件。 However the step the step does not give any result. 但是,该步骤的步骤不会产生任何结果。

How can I get the desired files containing "q1". 如何获得包含“ q1”的所需文件。

select only those files whose names contain "q1". 仅选择名称包含“ q1”的文件。 However the step the step does not give any result. 但是,该步骤的步骤不会产生任何结果。

grep finds patterns, and q1 is a perfectly fine pattern on its own. grep找到模式,而q1本身就是一个非常好的模式。

git show commit:.data/path/to/file/ | grep q1

该命令似乎是错误的,请尝试以下操作:

git show commit:.data/path/to/file | grep "q1"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM