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.
![E32- No file name E32- No file name](https://code2care.org/linux/wq-vi-error-e32-no-file-name-write-and-quit/images/E32- No file name.jpg)
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!
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to vi,
- How to add Colors to VIM (syntax highlighting)
- How to perform Find and Replace using vim Editor
- How to update VIM version on a Mac
- How to Select All Text in Vim/Vi editor
- Guide: Install Vim on Mac
- The Vim (vi) Mac Configuration File Details
- Fix :wq! Vi Error - E32: No file name (when write and quit)
- How to Copy all text to Clipboard in Vim
- How to Uninstall Vim on Mac?
More Posts:
- Read Text file from SD Card : Android Programming - Android
- Save a file as CSV Format TextEdit on Mac - MacOS
- Fix - E: Package python3-pip has no installation candidate - PIP
- PHP.ini: How to Remove URL Forward Slash Before Single or Double Quotes - PHP
- Install Native Java JDK JRE on Apple Silicon M1 Mac - MacOS
- How to make Text in TextView bold and italic in Android - Android
- Fix: Unsupported Java. Your build is currently configured to use Java 17.0.5 and Gradle 7.1. - Gradle
- 3 Ways to find if element is present in a List in Python - Python