How to Use Termux: Complete Guide for Beginners and Advanced Users

Last update: 18/03/2025
Author Isaac
  • Termux is a terminal de Linux to Android that allows you to run commands and scripts without the need for root.
  • It includes a package manager that allows you to install essential Linux tools such as bash, vim, or git.
  • You can automate tasks, access remote servers using SSH and customize your configuration with .bashrc.
  • It allows you to install complete Linux distributions and perform security tests with specialized tools.

termux

If you've ever wanted to bring the power of a Linux terminal to your Android device, Termux Termux is the perfect tool for this. This terminal emulator allows you to run commands, install Linux packages, and even develop scripts, all without the need for root. In this guide, we'll explore in detail what Termux is, how to install and configure it, and discover all the potential it offers.

Throughout this article, you'll learn everything from the basics to advanced features, including package management with APT, connecting to servers using SSH, installing development environments, and running automated scripts. Let's get started!

What is Termux?

termux

Termux is an Android application that provides a Linux-based terminal environment. It functions as a miniature Linux distribution, allowing you to run commands, install packages, and access the device's file system.

One of the most outstanding advantages of Termux is that does not require root permissions to run most of its functions. This makes it an accessible tool for any user who wants to delve into the world of the command line without extensively modifying their device. If you're looking for more information on terminal emulators, you can check out details about Terminal emulators for Android.

Installation and initial configuration of Termux

Before starting to use Termux, we must first install and configure it properly:

Download and install Termux

  • Download Termux from the store F-Droid. Version of Google Play Store does not receive recent updates, so it is recommended to avoid it.
  • Si downloads the APK from its official website, remember to enable installation from “Unknown Sources” in your phone’s settings.
  replace Hbo Max on a Samsung TV?

Configure permissions and storage

After installing Termux, it is essential give him access to storage:

termux-setup-storage

This command creates shortcuts to folders in the Android file system, such as Downloads, DCIM, Music and others, within the board of directors ~/storage/.

Update packages

To ensure that we have the latest version of the packages available in Termux, it is recommended to run:

apt update && apt upgrade -y

This will update the package list and install the latest available versions.

terminal
Related article:
What is the best terminal emulator for Android?

Basic Termux Commands

If you have never used a terminal in Linux, here are some tips. essential commands:

  • ls – Lists the contents of a folder.
  • cd – Change directory.
  • pwd – Displays the path of the current directory.
  • cp – Copy files or folders.
  • mv – Move or rename files.
  • rm – Delete files. Use with caution.
  • mkdir – Create a new folder.
  • clear – Clean the terminal screen.

Package management in Termux

Termux uses APT (the same package management system as Debian and Ubuntu) to install additional tools and programs.

Install packages

To install a package, uses:

pkg install nombre_del_paquete

Example:

pkg install vim

Search packages

If you would like to find a specific package, uses:

pkg search nombre_del_paquete

Remove packages

If you no longer need a package, you can delete it with:

pkg uninstall nombre_del_paquete

Connect Termux to other devices with SSH

SSH (Secure Shell) allows you to access servers remotely and securely. To install SSH in Termux:

pkg install openssh

Start the SSH server

Termux can act as ssh-server, allowing remote connections:

sshd

To connect from another device to Termux, you will need the Your phone's IP:

ifconfig

Then, connect from another device using:

ssh usuario@IP -p 8022
android terminal
Related article:
How to master the terminal emulator on Android

Automation and scripts in Termux

Termux allows the script execution to automate repetitive tasks. A basic example of script To display “Hello, world” would be:

echo "echo Hola, mundo" > hola.sh
chmod +x hola.sh
./hola.sh

Customizing Termux

We can customize the terminal editing the file .bashrc:

vim ~/.bashrc

Personalization example:

PS1="\[\033[1;32m\]\u@\h:\[\033[1;34m\]\w\[\033[0m\]$ "

This will change the look of the command line. Exploring the possibilities of Termux opens up endless opportunities for using advanced commands, developing scripts, and connecting to servers from your Android. With this guide, you'll have everything you need to start using Termux effectively and get the most out of it.

Leave a comment