Getting Started with nano - The Beginner-Friendly Editor Before Vim

Getting Started with nano - The Beginner-Friendly Editor Before Vim

Why nano First?

Lina: I want to edit a text file but Vim looks really scary…
Linny-senpai: That's totally normal! That's exactly why we start with nano — it's way easier to pick up.

Linux has several text editors. nano stands out for beginners because keyboard shortcuts are always shown at the bottom of the screen — no memorizing required.

Why nano is beginner-friendly

  • Shortcuts are always visible at the bottom of the screen
  • No special modes — just start typing right away
  • Widely available on Linux servers

Opening nano

Lina: How do I start it?
Linny-senpai: Just type nano followed by the filename — that's it!
nano filename

Example: opening memo.txt

nano memo.txt

If the file doesn't exist yet, nano will create it when you save.

What You See After Opening

  GNU nano 6.2                   memo.txt

▌

^G Help       ^O Write Out  ^W Where Is   ^K Cut        ^T Execute
^X Exit       ^R Read File  ^\ Replace    ^U Paste       ^J Justify
Lina: The screen is mostly empty, but there's a lot at the bottom?
Linny-senpai: Those two lines at the bottom are your shortcut cheat sheet! The ^ symbol means the Ctrl key. So ^O means Ctrl+O.

Reading the screen

  • Top line: filename
  • Middle area: your editing space
  • Bottom 2 lines: shortcut reference (^ = Ctrl)

Editing Text

Lina: Can I just start typing after opening a file?
Linny-senpai: Exactly! nano drops you straight into editing mode — no special key needed first. Unlike Vim, you don't have to press i before typing.

Just start typing wherever the cursor is.

Moving around:

Key Action
Arrow keys Move cursor
Home / End Start / end of line
Page Up / Down Scroll one screen
Ctrl+A Go to start of line
Ctrl+E Go to end of line

Deleting text:

Key Action
Backspace Delete character before cursor
Delete Delete character after cursor
Ctrl+K Cut entire line

Saving

Lina: I've made my edits! How do I save?
Linny-senpai: Press Ctrl+O. Think of "O" as "Output" — writing the content out to disk.

Press Ctrl+O and nano will ask you to confirm the filename:

File Name to Write: memo.txt

Just press Enter to save with the same name.

To save under a different name, change the filename before pressing Enter.

Lina: I pressed Ctrl+O then Enter — saved!
Linny-senpai: Perfect. Now let's exit.

Exiting

Press Ctrl+X to exit.

Lina: What happens if I press Ctrl+X without saving?
Linny-senpai: nano asks you first — it won't throw away your work without checking.

If you have unsaved changes, nano asks:

Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES)?
Key Action
Y Save and exit
N Exit without saving (discard changes)
Ctrl+C Cancel (go back to editing)

Key Shortcuts to Know

Lina: Do I need to memorize all those shortcuts at the bottom?
Linny-senpai: Start with just four — save, exit, search, and cut/paste. That covers 90% of daily use.

Start with these 4

Shortcut Action
Ctrl+O Save (write to file)
Ctrl+X Exit
Ctrl+W Search
Ctrl+K / Ctrl+U Cut line / Paste line

More Useful Shortcuts

Shortcut Action
Ctrl+G Open help
Ctrl+C Show cursor position (line number)
Ctrl+V Scroll down one page
Ctrl+Y Scroll up one page
Alt+U Undo
Alt+E Redo
Lina: What if I need to find something specific in a long file?
Linny-senpai: Ctrl+W searches, and Ctrl+\ does find-and-replace.

Search (Ctrl+W)

  1. Press Ctrl+W
  2. Type what you're looking for
  3. Press Enter

To find the next match, press Ctrl+WEnter again.

Replace (Ctrl+\)

  1. Press Ctrl+\
  2. Enter search text → Enter
  3. Enter replacement text → Enter
  4. Confirm each match with Y / N, or press A to replace all

Practical Example: Editing a Config File

Lina: Can I use nano to edit server config files too?
Linny-senpai: Absolutely! Just add sudo in front — like sudo nano /etc/hosts.
sudo nano /etc/hosts

Before editing important files

Always make a backup first:

sudo cp /etc/hosts /etc/hosts.bak

Then edit safely with sudo nano /etc/hosts.

Summary

Lina: nano was way easier than I expected!
Linny-senpai: Right? Seeing the shortcuts on screen removes all the guesswork. Use nano while you're getting started, then gradually pick up Vim as you need more power.
Task Key
Open a file nano filename
Save Ctrl+O → Enter
Exit Ctrl+X
Search Ctrl+W
Cut a line Ctrl+K
Paste Ctrl+U
Undo Alt+U

Next Reading