edit file bash code example
Example 1: edit file terminal
vim filename.txt
//press i to enter insert mode
//press esc to exit insert mode
type :wq then enter to leave vim
Example 2: edit text file bash
sudo nano file.text
vim filename.txt
//press i to enter insert mode
//press esc to exit insert mode
type :wq then enter to leave vim
sudo nano file.text