Articles → Linux → Vi Editor In Linux

Vi Editor In Linux






Purpose





Work On The Vi Editor




  1. Open "MobaXTerm".
  2. Click on the "Session" button.
  3. Picture showing the Session button to connect to linux server using MobaXTerm
    Click to Enlarge

  4. A pop-up window will appear. Click on the SSH button.
  5. Enter the "Remote host", "UserName" and "private key". Click on the "Ok" button.
  6. Picture showing the option to enter the remote host and username in MobaXTerm
    Click to Enlarge

  7. If you are not a root user then you can execute the following command to switch to the root user.
  8. sudo -i


  9. Enter the following command to create a new file.
  10. touch karan.txt




  11. Write the following command to open the text file in the insert mode.
  12. vi karan.txt


  13. The file is opened in the edit mode.
  14. Picture showing the opening of file using vi editor
    Click to Enlarge

  15. To save and close the file, use the following command.
  16. SHIFT+ESC
    :wq
    Enter



Check The Content Of The Text File




cat karan.txt


Picture showing the content of the file using the cat command
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, November 11, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250