Essential Nano & Vim Commands for Total Beginners (Linux & Server Editing)

Published: (December 6, 2025 at 02:37 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

Introduction

When working on Linux or connecting to a remote server, you often need to open and edit files directly in the terminal. This includes tasks like updating configuration files, fixing environment variables, editing server settings, or quickly changing code. Linux provides two main terminal‑based text editors: nano (easy) and vim (powerful). This cheat sheet explains both in a beginner‑friendly way.

Nano Cheat Sheet

Opening a file

nano filename.txt

Key Bindings

ActionKeysExplanation
Save fileCTRL + OWrites your changes
Exit nanoCTRL + XAsks to save if needed
Cut lineCTRL + KRemoves whole line
Paste lineCTRL + UPastes last cut
SearchCTRL + WFind words
Go to lineCTRL + _Navigate fast
UndoALT + UUndo changes
RedoALT + ERedo undone changes

When to use Nano

  • Simple tasks
  • Editing configs
  • Avoiding complex shortcuts

Vim Cheat Sheet

Opening a file

vim filename.txt

Modes

ModePurpose
NormalMove around & issue commands
InsertType text normally
VisualSelect text

Basic Insert Mode Keys

ActionKey
Enter insert modei
Insert at end of lineA
New line belowo
Back to normal modeESC

Common Commands

ActionCommand
Save:w
Quit:q
Save & quit:wq or ZZ
Quit without saving:q!
ActionKey
Move left/down/up/righth j k l
Start of line0
End of line$
Top of filegg
Bottom of fileG

Editing

ActionCommand
Delete characterx
Delete linedd
Copy lineyy
Pastep
Undou
RedoCTRL + r

Searching

ActionCommand
Search/word
Next matchn
Previous matchN

When to use Vim

  • Remote servers where nano isn’t installed
  • Advanced editing
  • Speed and power

Conclusion

Enjoy editing confidently on Linux and servers!

Back to Blog

Related posts

Read more »