zoukankan      html  css  js  c++  java
  • Linux命令之vi篇

    作业二:

    1)  使用vi编辑器编辑文件/1.txt进入编辑模式写入内容“hello world”

    [root@localhost ~]# vi 1.txt

    2)  进入命令行模式复制改行内容,在下方粘贴80行

    Vim 1.txt

    插入模式

    yy80p

    [root@localhost ~]# vi 1.txt

     

    3)  快速移动光标到文件的最后一行

    [root@localhost ~]# vi 1.txt

        L

    4)  快速移动光标到当前屏幕的中间一行

    [root@localhost ~]# vi 1.txt

    M

    5)  快速移动光标到文件的第五行

    [root@localhost ~]# vi 1.txt

         5G

    6)  在下方插入新的一行内容“welcome to beijing”

    [root@localhost ~]# vi 1.txt

    a

      

    7)  删除刚插入的一行

    dd

    8)  撤销上一步的操作

    U

    9)  进入扩展模式,执行文件的保存退出操作

    wq

  • 相关阅读:
    48. Rotate Image
    47. Permutations II
    46. Permutations
    45. Jump Game II
    44. Wildcard Matching
    43. Multiply Strings
    42. Trapping Rain Water
    41. First Missing Positive
    40. Combination Sum II
    39. Combination Sum
  • 原文地址:https://www.cnblogs.com/asaka/p/6561867.html
Copyright © 2011-2022 走看看