Linux, terminal and Git

Stage 2 · Lesson 9 of 9

Editing files in the terminal: nano and Vim

Shell basics

On a server there is usually no , so you need a , one that runs inside the terminal. nano is the simplest. Its shortcuts are listed along the bottom: Ctrl+O saves and Ctrl+X exits. Vim (or vi) is installed almost everywhere and is powerful, but it has modes.

You start in , where keys are commands. Press i to insert text, Esc to go back, then type :wq to save and quit, or :q! to quit without saving. opens an editor for some commands, so you will meet one sooner or later. Run vimtutor for a 30-minute guided lesson.

Common trapbeing stuck inside Vim with no idea how to leave, so learn the exit commands before you need them.

A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it

Resources for this stage

Start with· follow one of these

Practise

  • A game played over SSH where each level needs a new command, from `ls` to finding hidden files

Keep handy

  • Paste any command and see what each part does before you run it

  • Short, example-first help pages for common commands when a man page is too long

Also worth your time

Mark this stage as not done?