Skip to content

Linux nano Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Linux nano Guide

Complete beginner-friendly guide to nano text editor on Linux, covering Arch Linux, CachyOS, and other distributions including installation, basic usage, and configuration.


Table of Contents

  1. nano Installation
  2. nano Basics
  3. nano Commands
  4. nano Configuration
  5. Troubleshooting

nano Installation

Install nano

Arch/CachyOS:

# Install nano
sudo pacman -S nano

# Usually pre-installed

Debian/Ubuntu:

sudo apt install nano

Fedora:

sudo dnf install nano

Launch nano

Start nano:

# Open file
nano filename.txt

# Create new file
nano newfile.txt

nano Basics

Interface

nano display:

  • Top: File name and status
  • Middle: Text area
  • Bottom: Command shortcuts

Basic Editing

Edit text:

  • Type: Start typing
  • Move cursor: Arrow keys
  • Delete: Backspace or Delete

⌨ nano Commands

Save and Exit

File operations:

  • Ctrl + O: Save (Write Out)
  • Ctrl + X: Exit
  • Ctrl + S: Save file

Navigation

Move around:

  • Ctrl + A: Beginning of line
  • Ctrl + E: End of line
  • Ctrl + W: Search
  • Ctrl + _: Go to line

Editing

Edit commands:

  • Ctrl + K: Cut line
  • Ctrl + U: Paste
  • Ctrl + J: Justify paragraph
  • Alt + A: Mark text

nano Configuration

Configuration File

Edit config:

# Edit nano config
vim ~/.nanorc

# Or system-wide
sudo vim /etc/nanorc

Common Settings

Configuration:

# Enable line numbers
set linenumbers

# Enable syntax highlighting
include /usr/share/nano/*.nanorc

# Set tab size
set tabsize 4

Troubleshooting

nano Not Starting

Check installation:

# Check nano
which nano
nano --version

# Install if missing
sudo pacman -S nano

Summary

This guide covered nano installation, basic usage, and configuration for Arch Linux, CachyOS, and other distributions.


Next Steps


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally