How to edit a text file in my terminal
Try this command:
sudo gedit helloWorld.txt
it, will open up a text editor to edit your file.
OR
sudo nano helloWorld.txt
Here, you can edit your file in the terminal window.
Open the file again using vi. and then press " i " or press insert key ,
For save and quit
Enter Esc
and write the following command
:wq
without save and quit
:q!