What about vi ?
vi is the (visual editor) for Unix / Linux.
The vi editor is a full screen editor and has two modes of operation:
Command mode commands which cause action to be taken on the file, and
Insert mode in which entered text is inserted into the file.
From command line type vi [/filepath/filename] you may need sudo if it requires elevated rights to save
sudo vi /var/www/html/index.html
In the Command Mode
- : initiates a vi command
- ! initate a shell command
- : this is a shell builtin command with empty output
- > redirect the output
- % vi substitutes this with the name of the current file
From the Insert mode to exit vi press (Escape) key to return to Command Mode:
To Exit the Command Mode you have 'no save' or 'save' options:
:q! - Quit without writing changes to file
:wq - Write changes to file and quit vi
Other