Nano Text Editor in Termux – Installation & Usage Guide

Nano is a simple and beginner-friendly command-line text editor that lets you create, edit, and save text files from the Termux terminal. It includes many useful features such as syntax highlighting, auto indentation, line numbers, search, and backup support. It is widely used by Linux and Termux users.

Here’s what you can do with Nano in Termux:

  • Create and edit text files.
  • Save file changes.
  • Show line numbers.
  • Enable auto indentationm
  • Open files in read-only mode.
  • Create backup files.
  • Use syntax highlighting.

Install Nano in Termux

Below are the simple commands to install Nano in Termux.

Update Termux packages.

pkg update && pkg upgrade -y

Install Nano.

pkg install nano -y

Check the installed version.

nano --version

Nano is now installed and ready to use.

Use Nano in Termux

After installing Nano, you can use the following commands to open files, edit text, enable different features, and perform various editing tasks.

Display the Nano help menu.

nano --help

Create or edit a text file.

nano myfile.txt

Open a file at a specific line.

nano +25 myfile.txt

Open a file in read-only mode.

nano -v myfile.txt

Show line numbers.

nano -l myfile.txt

Enable auto indentation.

nano -i myfile.txt

Create backup files automatically.

nano -B myfile.txt

Display the Nano version.

nano -V

List available syntax definitions.

nano -z

Use syntax highlighting.

nano -Y python script.py

Save the current file.

CTRL + O

Exit Nano.

CTRL + X

Search for text.

CTRL + W

You can use these commands to create, edit, view, and manage text files easily.

End Note

Nano is a simple and easy-to-use text editor for Termux. It helps you create and edit text files, scripts, and configuration files from the terminal. Its easy commands and useful features make it a great choice for both beginners and experienced users.

SHARE THIS POST: