Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
have    at  least   a   basic   working knowledge   of  these   standard    editors so  that
you can walk up to any system and start working when necessary.

Working with nano


We discuss nano first because it has the easiest learning curve. It is neither
the most powerful nor the most “guru approved,” but nano is a respectable
text editor that you can run from the command line, and it’s often perfect for
quick tasks such as editing configuration files.


Learning how to use nano is quick and easy. You might need to edit files on
a Linux system with a minimal install or a remote server without a more
extensive offering of installed text editors. Chances are nearly 100% that
nano will be available.


You can start an editing session by using the nano command like this:


Click here to view code image
matthew@seymour:~$ nano file.txt


When you first start editing, you see the text on the screen with a title bar
across the top and a list of simple commands across the bottom. The editor is
simple enough that you can use it without any instruction. Here are the basic
commands, just so you can compare them with other editors discussed here:


Cursor  movement—Arrow  keys    (left,  down,   up, and right), Page    Up
and Page Down keys, or Ctrl+y and Ctrl+v page up and down
Add characters—Type at the cursor location
Delete character—Backspace or Delete
Exit—Ctrl+x (prompts to ask whether to save changes)
Get Help—Ctrl+g
NOTE
nano really is very easy to use, but this does not mean it cannot be used by
power users. Take a little time and read the contents of Help to discover
some of the interesting and powerful capabilities of this editor.

Working with vi


The one editor found on nearly every UNIX and Linux system is the vi
editor, originally written by Bill Joy. This simple-to-use but incredibly

Free download pdf