我的 LIST 文件中有很多行,只想列出名称不以(或包含)“git”开头的行。
到目前为止我有:
cat LIST | grep ^[^g]
Run Code Online (Sandbox Code Playgroud)
但我想要类似的东西:
#not starting by "git"
cat LIST | grep ^[^(git)]
#not containing "git"
cat LIST | grep .*[^(git)].*
Run Code Online (Sandbox Code Playgroud)
但这是不正确的。我应该使用什么正则表达式?