Linux Editors & editor commands
Linux Editors & editor commands
Linux text editors can be used for editing text files, writing codes, updating user
instruction files, and more. A Linux system supports multiple text editors. There are
two types of text editors in Linux, which are given below:
• Command-line text editors such as Vi, nano, pico, and more.
• GUI text editors such as gedit (for Gnome), Kwrite, and more.
A text editor plays an important role while coding. So, it is important to select the best
text editor. A text editor should not only be simple but also functional and should be
good to work with.
Vi / Vim:
•Open a file: vi filename or vim filename
•Insert mode (for editing): Press i
•Save changes and exit insert mode: Press Esc, then type :w and press Enter
•Save changes and exit: Press Esc, then type :wq and press Enter
•Exit without saving: Press Esc, then type :q! and press Enter
Linux Editors & editor commands
2. Nano editor
Nano is a straight forward editor. It is designed for both beginners and advanced users.
It has many customization features.
• It has highly customizable key bindings
• It supports syntax highlighting
• It has undo and redo options
• It provides full line display on the standard output
• It has pager support to read from standard input
To open file with nano editor, execute the command as follows:
nano <file name>
The nano editor looks like:
Linux Editors & editor commands
Nano:
•Open a file: nano filename
•Save changes: Press Ctrl + O, then press Enter
•Exit: Press Ctrl + X
Linux Editors & editor commands
3. Gedit editor
Gedit editor is the default editor for the GNOME desktop environment. When we open
a file, it will open with the Gedit editor. It provides straightforward functionalities like
any basic text editor. It is a lightweight editor with a straight forward user interface. It
was publicly released in the year 2000 with a GNOME desktop environment. It is
developed using the C programming language and supports all font family.
Some key features of the gedit text editor are as following:
• It provides syntax highlighting.
• It supports internationalized text.
• It supports several programming languages.
To invoke the gedit editor from the terminal, execute the below command:
gedit <file name>
It looks like:
Linux Editors & editor commands