Question: How to Save a File in Linux Command Line?
Contents Once You Have Modified a File, Press [Esc] Shift to the Command Mode and Press: W and Hit [Enter] as Shown Below. to Save the File and Exit at the...
Contents
Once you have modified a file, press [Esc] shift to the command mode and press :w and hit [Enter] as shown below.
To save the file and exit at the same time, you can use the ESC and key and hit [Enter] .
Optionally, press [Esc] and type Shift + Z Z to save and exit the file.
How do I save a file in Linux command?
After making changes to a file, press [Esc] to shift to the command mode and press :w and hit [Enter] to save a file. To exit Vi/Vim, use the :q command and hit [Enter] . To save a file and exit Vi/Vim simultaneously, use the :wq command and hit [Enter] or command.
Must Read
How do you save a file in Terminal?
2 Answers
- Press Ctrl + X or F2 to Exit. You will then be asked if you want to save.
- Press Ctrl + O or F3 and Ctrl + X or F2 for Save and Exit.