In Linux, the vi File Save exit command ': wq' and': x' are different vi is one of the most common editors in UNIX/Linux systems. I am used to using ": x "command to save the file and exit, do not want to use the": wq "command because it is more than a letter.
But today I know the real difference between ": x" and ": wq", as follows:
: Wq is mandatory to write files and exit. Write the file forcibly even if it is not modified, and update the modification time of the file. Www.2cto.com: x write the file and exit. The file is written only when the file is modified and the file modification time is updated. Otherwise, the file modification time is not updated. In general, the two are not the same, but programming may have an important impact on editing source files. Even if the file is not modified, ": wq" forces the update of the file's modification time, which will make the entire project to assume that the file has been modified, then you have to recompile the link to generate an executable file. This may cause people to misunderstand the consequences. Of course, it also produces unnecessary system resource costs. This article is from the fat shark network.