gpt4 book ai didi

linux - grep "^ *` 字“语法 linux

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:23:22 25 4
gpt4 key购买 nike

我在工作中使用 linux,无论如何我都是新手,我被告知使用 grep 命令

grep –r <missing err> . | grep "^ *`define"

我假设 ^ 代表一行的开头?但我不确定 * 和 `(勾号)的作用是什么?

谁能解释一下这是如何工作的!我将不胜感激!

最佳答案

I'm assuming the ^ stands for the start of a line?

...but I'm not sure what the * and the ` (tick) are for?

星星说匹配前面的字符 0 次或更多次

反引号可以执行命令替换(如$())。即使在引用时它似乎仍然这样做。但是,只使用这样的一个是没有意义的(它们需要平衡)。如果您想要文字反引号,请在其前面加上 \

有关更多信息,请运行 man grep(它具有这些符号的定义)。

关于linux - grep "^ *` 字“语法 linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17625076/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com