Edit Text Files Using Vi Command
Similar to nano command , Vi Command also gives you the ability to create as well as edit the text file at the same time .To create a new file , run the command given below:
vi test5.txt
- Press the ESC key for normal mode.
- Press i Key for insert mode.
- Press q! keys to exit from the editor without saving a file.
- Press wq! Keys to save the updated file and exit from the editor.
- Press w test.txt to save the file as test.txt
Also check more Basic vi Commands
How to Edit Text Files in Linux?
Like any other OS, creating and editing Text files is an important skill to be known to any user. In this article, we will learn how to easily create and edit Text files in Linux using simple and basic terminal commands such as cat, touch, nano, vi, and standard redirect symbol.
Table of Content
- What is Text File in Linux?
- How to Open Text Files in Linux?
- How to Edit Text Files in Linux?