美文网首页
Linux Vi 删除全部内容,删除某行到结尾,删除某段内容 的

Linux Vi 删除全部内容,删除某行到结尾,删除某段内容 的

作者: YsY_4469 | 来源:发表于2018-09-17 11:29 被阅读0次

1.open this file

vi fileName


2 transfer to the back of this file

G


3 transfer to the 9th line

9G


4delete all data of this file

:1,.d


删除说明:这是在vi中 ,“.”当前行 ,“1,.”表示从第一行到当前行 ,“d”删除


1,$d 也可以其中 $代表最后一行

相关文章

网友评论

      本文标题:Linux Vi 删除全部内容,删除某行到结尾,删除某段内容 的

      本文链接:https://www.haomeiwen.com/subject/qmvknftx.html