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.
我创建了一个函数来搜索文件中的所有双行。
我使用“行号”g/.*/d 删除该行。
但是我想确认是否必须删除一行,例如 s/..//gc 命令
是否可以使用全局或替代命令删除某一行 并确认每个操作?
为什么不尝试替代命令而不是删除命令?
"line-number"s/^.*$\n//c
如果我想删除文件中的行并确认每一行,我会:
dd
n
.