gpt4 book ai didi

linux - 使用 grep 搜索包含 [insert text] 的行

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

我正在尝试搜索仅包含一组括号 [....] 且括号内有文本的行

因此不会打印不包含一组右括号的行。我将如何使用 grep 解决这个问题?

最佳答案

试试这个

grep -e '^\[.+\]$' file-name

关于linux - 使用 grep 搜索包含 [insert text] 的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22137675/

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