I am new to linux, when I typed "vi FILE1" I was able to open VI editor. I added some data and I want to save the file and I tried :w but it threw me an error.
"file1" E212: Can't open file for writing Press ENTER or type command to continue
why I am not able to save it?
The directory in which I am creating file has following permissions:
drwxr-xr-x 4 pentaho pentaho 4096 Mar 12 2013 master
I am logging using root user and password.
Output of mount
command :
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sdb1 on /etl type ext4 (rw)
/dev/sdc1 on /oracle type ext4 (rw)
/dev/sdd1 on /export type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
How To Save A Vi File Linux? If you want to save a file, you must first have it in Command mode. When you press Esc in Command mode, typing :wq to write the will be the easiest method. By pressing ZZ you will access the next writing method quicker. When the vi in non-vi is initiated, write is done as usual, and quit is done.
Once you have modified a file, press [Esc] shift to the command mode and press :w and hit [Enter] as shown below. Save File in Vim. To save the file and exit at the same time, you can use the ESC and :x key and hit [Enter]. Optionally, press [Esc] and type Shift + Z Z to save and exit the file.
Overwriting a read-only file, or a file that already exists. The command sequence for saving a file in the vi text editor is as follows: Pressing Esc exits any editing mode.
Use Linux or Unix to open the terminal application. You may then choose the name of the file in vim / vi. Ctrl and C keys should be used to open an opened file in Vim / vi. The first way is to hit Enter key, then press Esc key and type:x in order to stop it from playing until it is turned off.
You can also get this error if the directory you are trying to save to does not exist. Even the root user will get this error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With