How to change file with cmd on linux

step 1: Go to the directory where file exists then use bellow command to open file

sudo vi filename

step 2: Press i to go to edit mode. now update your file

step 3: Now press Esc then type :wq!  to save and exit.

Comments