Termux Help

Introduction

Termux is a terminal emulator for Android combined with a collection of packages for command line software. This help explains both the terminal interface and the packaging tool available from inside the terminal.

Want to ask a question, report a bug or have an idea for a new package or feature? Visit the Google+ Termux Community!

User interface

At launch Termux shows a terminal interface, whose text size can be adjusted by pinch zooming or double tapping and pulling the content towards or from you.

Besides the terminal (with keyboard shortcuts explained below) there are three additional interface elements available: A context menu, navigation drawer and notification.

The context menu can be shown by long pressing anywhere on the terminal. It provides menu entries for:

The navigation drawer is revealed by swiping from the left part of the screen. It has three elements:

The notification, available when a terminal session is running, is available by pulling down the notification menu. Pressing the notification leads to the most current terminal session. The notification may also be expanded (by pinch-zooming or performing a single-finger glide) to expose three actions:

With a wake or wifi lock held the notification and Termux background processes will be available even if no terminal session is running, which allows server and other background processes to run more reliably.

Using a touch keyboard

Using the Ctrl key is necessary for working with a terminal - but most touch keyboards does not include one. For that purpose Termux uses the Volume down button to emulate the Ctrl key. For example, pressing Volume down+L on a touch keyboard sends the same input as pressing Ctrl+L on a hardware keyboard. The result of using Ctrl in combination with a key depends on which program is used, but for many command line tools the following shortcuts works:

The Volume up key also serves as a special key to produce certain input:

Using a hardware keyboard

The following shortcuts are available when using Termux with a hardware (e.g. bluetooth) keyboard by combining them with Ctrl+Shift:

Package management

A minimal base system consisting of the Apt package manager and the busybox collection of system utilities is installed when first starting Termux. Additional packages are available using the apt command:

apt update
Updates the list of available packages. This commands needs to be run initially directly after installation and regularly afterwards to receive updates.
apt search <query>
Search among available packages.
apt install <package>
Install a new package.
apt upgrade
Upgrade outdated packages. For Apt to know about newer packages you will need to update the package index, so you will normally want to run apt update before upgrading.
apt show <package>
Show information about a package.
apt list
List all available packages.
apt list --installed
List all installed packages.
apt remove <package>
Remove an installed package.

Apt as a package manager uses a package format named dpkg. Normally direct use of dpkg is not necessary, but the following two commands may be of use:

dpkg -L <package>
List installed files of a package.
dpkg --verify
Verify the integrity of installed packages.

View the apt manual page (execute apt install man to install a man page viewer first) for more information.

Text editing

By default the busybox version of vi is available. This is a barebone and somewhat unfriendly editor - install nano for a more straight-forward editor and vim for a more powerful one.

Using SSH

By installing the openssh package (by executing apt install openssh) you may SSH into remote systems, optionally putting private keys or configuration under $HOME/.ssh/.

If you wish to use an SSH agent to avoid entering passwords, the Termux openssh package provides a wrapper script named ssha (note the 'a' at the end) for ssh which:

  1. Starts the ssh agent if necessary (or connect to it if already running).
  2. Runs ssh-add if necessary.
  3. Runs ssh with the provided arguments.

This means that the agent will prompt for a key password at first run, but remember the authorization for subsequent ones.

Interactive shells

The base system that is installed when first starting Termux uses the bash shell while zsh is available as an installable alternative:

Termux and Android

Termux is designed to cope with the restrictions of running as an ordinary Android app without requiring root, which leads to several differences between Termux and a traditional desktop system. The file system layout is drastically different:

Besides the file system being different, Termux is running as a single-user system without root - each Android app is running as its own Linux user, so running commands inside Termux may not interfere with other installed applications.

Running as non-root implies that ports below 1024 cannot be bound to. Many packages have been configured to have compatible default values - the ftpd, httpd, and sshd servers default to 8021, 8080 and 8022, respectively.

Add-on: API

The API add-on exposes Android system functionality such as SMS messages, GPS location or the Text-to-speech functionality through command line tools.

Add-on: Float

The Float add-on consists of a floating terminal window visible while running other apps.

Add-on: Styling

The Styling add-on provides color schemes and fonts to beabeautify and customize the appearance of the Termux terminal.

Add-on: Widget

The Widget add-on brings a widget to your homescreen, providing links to run scripts in your $HOME/.shortcuts/ folder.

Source and licenses

Termux uses terminal emulation code from Terminal Emulator for Android which is under the Apache License, Version 2.0. Packages available through Termux are distributed under their respective licenses with scripts and patches used to build them available on github.