This example is applicable for both Vi and Vim text editors.
Fix :wq! Vi Error - E32: No file name (when write and quit)
If you are trying to save a file using :wq! command in Vi and you get an error - E32: No file name, well then the chances are that you are trying to write to a file, but you haven't created a file.
You may have simply opened the vi/vim editor using the command and not proving the file name.

Fix:
You will need to save the file using the command below.
Syntax::w {filename}
Example
:w {data.txt}
"{data.txt}" [New] 3L, 17B written
Now if you try to do :wq! you should not get any errors!
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!