Home  >  Q&A  >  body text

linux - How to save another configuration file in the shell.

1. How to write in the shell:
Save the vim configuration file
For example, if a file is called abc.conf
To write in the shell:
vim /abc.conf
i How to save and exit after key insertion and modification
(not directly wq/ZZ in vim)

怪我咯怪我咯2713 days ago634

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:24:42

    If you want to modify it through script/abc.conf, 那就别用vim, 可以尝试下sed/awk, if necessary, you can describe the problem in more detail and I can provide the corresponding statement

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 13:24:42

    echo "Content to be inserted" >>/abc.conf This will directly append content to the file.

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-16 13:24:42

    Vim is interactive, and the shell script is a new shell. How do you open an interactive editor in a new shell? . . You should just use sed

    reply
    0
  • Cancelreply