Termux is a powerful Android app that lets you run Linux commands directly from a mobile device without root. With this terminal emulator, you can access a wide variety of tools, install packages, program scripts, and perform multiple advanced tasks without needing a desktop computer.
In this comprehensive guide, you'll learn everything from installing Termux to its advanced configuration, including basic and commonly used commands, package management, using text editors, and even running web servers or remote access via SSH. If you're looking to get the most out of your Android device with a functional and customizable terminal, you've come to the right place.
What is Termux?
Termux is an Android application that provides a linux terminal Fully functional. Its main advantage is that it doesn't require rooting the device to access its functions and allows you to install command-line tools similar to those of a GNU/Linux distribution.
Installing and Getting Started with Termux on Android
Before you start using Termux, you must install it correctly. There are several ways to do this, but the main recommendation is to download it from the F-Droid Store instead of the Play Store, since Google has imposed restrictions that affect its operation.
Steps to install Termux on Android
- Download F-Droid from its official website and install it on your device.
- Search for Termux within F-Droid and select the installation option.
- Once installed, open the app and start the initial setup.
Basic configuration after installation
Before you start using Termux, it is recommended to update your packages with the following commands:
apt update && apt upgrade -y
Additionally, to allow Termux to access the device's storage files, run:
termux-setup-storage
Basic commands in Termux for Android
One of the essential aspects of using Termux is learning how to use its commands. Here are some of the most commonly used ones:
- ls: Lists files and directories in the current location.
- cd: Change directory.
- rm: Deletes files or directories.
- mkdir: Create a new directory.
- touch: Creates an empty file.
- threw out: Writes text to a file.
- cat: Displays the contents of a file.
Package management in Termux
To install additional tools in Termux, use pkg o aptSome of the most important packages you can install include:
- pkg install nano: Installs the Nano text editor.
- pkg install vim: Installs the Vim text editor.
- pkg install openssh: Installs the SSH server and client.
- pkg install python: Install Python for programming.
- pkg install git: Install Git to manage repositories.
Using SSH for remote access
Termux allows you to configure and run an SSH server on your device, making remote administration easier. To set it up, follow these steps:
apt install openssh
sshd
To access from another device, use:
ssh usuario@direccion-ip -p 8022
You must replace user by username in the system and IP adress by the IP address of the device with Termux.
Creating a web server in Termux for Android
To run a web server in Termux using Python, follow these steps:
cd /sdcard
python3 -m http.server 8080
From a browser on the same device or another connected to the same network, access http://127.0.0.1:8080 to verify that the server is running.
Automation with Bash scripts
In Termux you can create Bash scripts to automate processes. For example, a script that prints a message to the screen:
#!/bin/bash
echo "Hola, este es un script en Termux"
Save it as script.sh and grant it execution permissions with:
chmod +x script.sh
./script.sh
Termux is a versatile and powerful tool that allows you to carry out the functionality of a system Linux to any Android device. With a good understanding of its commands and tools, you can use it to program, manage servers, remotely access devices, and much more, making it an essential tool for those who need a Linux environment on their mobile device without too much hassle. Share this guide and help other users learn how the tool works..