Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例子:
... Line some text other text 10 ...
是否可以告诉 GREP ^Line.*?^10$,以便点匹配也换行,我得到这个输出:
^Line.*?^10$
Line some text other text 10
如果没有,是否有一些 Linux CLI 工具可以做到这一点?
Line如果您打算在和之间输出行10,我建议使用 awk:
Line
10
awk '/^Line$/,/^10$/' myfile
使用sed:
sed
sed -rn '/^Line$/,/^10$/p' filename