Lion Cipher Lab
Editing files from the terminal: nano and vim
- Foundations
- Beginner
- ~30 min
- Free · no account required
Why it matters
Configuring almost anything on a Linux box means editing a text file that lives on that box — a service config, an SSH setting, a hosts entry. There's no window to click; you open the file, change a line, and save, right there in the terminal. nano makes that gentle because it prints its shortcuts on screen. vim matters because it is the editor you can count on being present on a stripped-down server or inside a container, so knowing four commands means you're never stranded on a machine you can't edit.
What you'll learn
- editing files in nano
- saving and exiting nano
- vim survival commands
- editing config files in place
Steps in this lab
- Why admins edit files right where they live
- Open a file in nano — and read the bar at the bottom
- Save with Ctrl+O, leave with Ctrl+X
- Why bother with vim: it's the editor that's always there
- Press i to insert, Esc to stop
- Save and quit with :wq — or bail out with :q!
- Which one when — and confirm your edits stuck
- You can edit any config now — here's what that unlocks