Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.15 KB

039-the-nano-command.md

File metadata and controls

51 lines (36 loc) · 1.15 KB

The nano command

The nano command lets you create/edit text files.

Installation:

Nano text editor is pre-installed on macOS and most Linux distros. It's an alternative to vi and vim. To check if it is installed on your system type:

nano --version

If you don't have nano installed you can do it by using the package manager:

Ubuntu or Debian:

sudo apt install nano

Examples:

  1. Open an existing file, type nano followed by the path to the file:
nano /path/to/filename
  1. Create a new file, type nano followed by the filename:
nano filename
  1. Open a file with the cursor on a specific line and character use the following syntax:
nano +line_number,character_number filename

Overview of some Shortcuts and their Functionalities:

Shortcut Description
Ctrl + S Save current file
Ctrl + O Offer to write file ("Save as")
Ctrl + X Close buffer, exit from nano
Ctrl + K Cut current line into cutbuffer
Ctrl + U Paste contents of cutbuffer
Alt + 6 Copy current line into cutbuffer
Alt + U Undo last action
Alt + E Redo last undone action