Command-Line Text Editors
vim
Powerful and Customizable
To open a file:
vim filename
Enter Insert mode:
i
Write anything once in insert mode
Save changes and exit:
Esc
, then:wq!
, andEnter
[cwid@hostname /athena/labname/scratch/cwid ]$ vim demo.txt -- opens current or will create new text file
Examples
Editing a Script with vim
Open terminal.
Type
vim myscript.sh
.Press
i
to enter Insert mode.Make your changes.
Press
Esc
to return to Normal mode.Type
:wq!
and pressEnter
to save and exit.