可能重复:
如何在多个文件的开头添加标签?
如何通过终端在文件开头插入文本?
如何使用 Linux shell 查找文件的多个单词?
我有
text
example
text
example
text
example
text
example
Run Code Online (Sandbox Code Playgroud)
我需要
text
example1
text
Example2
text
example3
text
example4
Run Code Online (Sandbox Code Playgroud)
也就是先定位词,再定位数字。