Articles → DevOps → vi editor in linuxvi editor in linuxIn this article, we will discuss vi editor in Linux.Purpose Vi is the default text editor of the linux system.Work on the vi editor For this example, we have created a virtual machine in Azure. To connect to the virtual machine. 1. Open "MobaXTerm". 2. Click on the "Session" button.Click to Enlarge 3. A pop-up window will appear. Click on the SSH button. 4. Enter the "Remote host", "UserName" and "private key". Click on the "Ok" button.Click to Enlarge 5. If you are not a root user then you can execute the following command to switch to the root user.sudo -i 6. Enter the following command to create a new file.touch karan.txtHere, "karan.txt" is the name of the text file. 7. Write the following command to open the text file in the insert mode.vi karan.txt 8. The file is opened in the edit mode.Click to Enlarge 9. To save and close the file, use the following command.SHIFT+ESC :wq EnterCheck the content of the text file To check the content file, use the following command.cat karan.txtClick to EnlargePosted By - Karan Gupta Posted On - Wednesday, November 11, 2020 Query/Feedback Your Email Id Subject Query/Feedback Characters remaining 250
sudo -i
touch karan.txt
vi karan.txt
SHIFT+ESC :wq Enter
cat karan.txt
Query/Feedback