Friday, October 21, 2011

UNIX difference btw :q and :q!

Open a file in vi editor and modify the content of the file.

Now try entering :q

of modern UNIX is the energy of the UNIX programming community; plenty of UNIX users
decide to write a new version of a command in order to solve slightly different problems, thus
spawning many versions of a command.
C
No write since last change (:quit! overrides)


You get the error as above. In this case you should enter :q!

Hence
:q means quit vi editor
:q! quit regardless of whether any changes have occured

No comments:

Post a Comment