The nano command

Nano's ANOther text editor, inspired by Pico 10 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Options in the examples

-B, --backup
When saving a file, back up the previous version of it, using the current filename suffixed with a tilde (~).
-l, --linenumbers
Display line numbers to the left of the text area.
-m, --mouse
Enable mouse support, if available for your system.

Examples

sudo nano /etc/hosts
nano ~/.bashrc
nano filename.txt
nano +50 filename.txt

Open at line 50

nano -l file.txt

Show line numbers

nano -m file.txt

Enable mouse

nano -B file.txt

Backup before editing

sudo nano /etc/systemd/system/myapp.service

Create the file

nano ~/scripts/backup.sh

Write it (the first line: #!/bin/bash)

sudo nano /etc/nginx/conf.d/shop.conf

Fix the line nginx -t points at

Lessons that use nano