美文网首页
vi命令 x wq 的区别

vi命令 x wq 的区别

作者: 5482698 | 来源:发表于2018-07-05 20:31 被阅读0次

    如果修改,则写入当前文件,并退出(与“:x”相同)。(注意:如果当前文件有多个窗口,则如果修改文件并关闭窗口,则写入该文件)。另一方面,WQ总是写入文件并退出VIM。
    Write current file, if modified, and quit (same as ":x"). (Note: If there are several windows for the current file, the file is written if it was modified and the window is closed). :wq on the other hand always writes the file and quits Vim.
    :wq 强制性写入文件并退出。即使文件没有被修改也强制写入,并更新文件的修改时间。
    :x 写入文件并退出。仅当文件被修改时才写入,并更新文件修改时间,否则不会更新文件修改时间。

    相关文章

      网友评论

          本文标题:vi命令 x wq 的区别

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