
Have you ever wondered if it's possible to have the power of Linux directly on your Android phone? If so, the answer is right here. Termux: an app that blurs the lines between smartphone and computer thanks to its fully functional terminal. Here you'll discover, through detailed explanations, how to get the most out of Termux by learning the basics. most useful commands, from basic to advanced, including file management, automation, servers, ethical hacking, and a complete Linux distribution.
This definitive guide to Termux In Spanish, it is designed so that anyone, from beginners to advanced users, can master this tool, take advantage of its potential, and learn step by step, with clear examples and useful resources.
What is Termux? Advantages over other emulators and environments

Termux is a free and open-source application that turns your Android device into a powerful Linux terminal environment, without the need for root. It differentiates it from other console emulators in that it doesn't require root permissions, offers performance similar to a real Linux system, and has its own package manager (pkg), based on apt, which allows you to install hundreds of GNU/Linux utilities (git, ssh, vim, python, nodejs, nmap, curl, and many more) with a single command.
- Handles hundreds of commands and Linux utilities from Android.
- It allows you to manage files and directories, edit scripts, set up servers, practice ethical hacking, program bots for Telegram, automate tasks, and much more.
- Supports full Linux distributions (Ubuntu, Debian, Kali, Alpine, etc.) via proot-distro.
- It does not require root permissions, is secure, and maintains isolation from the Android system.
Downloading and installing Termux on Android: recommended steps

- Download F-Droid: Termux is kept updated on F-Droid, not Google Play. Access f-droid.org and download the APK.
- Install Termux from F-Droid: Once you have downloaded and installed F-Droid, search for “Termux” and proceed to install the official app.
- Open Termux: You will see the terminal prompt ready to use.
After installation, run:
pkg update && pkg upgrade -y
To give Termux access to files on your phone's storage, run:
termux-setup-storage
A permissions window will open, accept, and you will be able to manage download files, photos, music and more from paths like ~/storage/downloads o ~/storage/pictures.
File structure and storage in Termux
The Termux file system resembles a Linux distribution, adapted for Android:
- /data/data/com.termux/files/home: Personal folder ($ HOME), where you can save scripts, projects, and files.
- ~/storage/: Android shared folder shortcuts, including:
- ~/storage/downloads – Downloads.
- ~/storage/pictures – Photos and screenshots.
- ~/storage/music – Music.
- ~/storage/movies – Videos.
- ~/storage/shared – Files shared by other apps.

To move files between Android and Termux, use these paths to avoid permission issues or data loss.
First basic commands in Termux for Linux on Android
Master these essential commands to manage files, navigate, and view information in the Terminal:
- ls: Lists files and directories.
Example:ls -lfor details,ls -ato include hidden files,ls --color=autofor colors. - cd: Change directory.
Example:cd downloads,cd ..to level up. - pwd: Displays the current route.
- cat: View files.
Ideal for logs, scripts or quick configurations. - touch: Create empty files.
Example:touch notas.txt - mkdir: Create folders.
Example:mkdir proyectos - cp: Copy files or folders.
Example:cp fichero.txt copia.txt,cp -r carpeta1 carpeta2 - mv: Move or rename files and directories.
Example:mv notas.txt antiguo.txt - rm: Delete files or folders.
Example:rm archivo.txt,rm -r carpeta/ - clear: Clears the command screen.
- the Commission: Displays the manual for other commands.
Example:man ls - threw out: Displays text or variables.
Example:echo "Hola Mundo"
Advanced file and permission management in Termux
Control permissions, search for files and manipulate directories:
- cp -v: Copy showing details.
- cp -n: Does not overwrite existing files.
- mv -v: Move with information.
- mv -i: Confirm before overwriting.
- find . -name «*.jpg»: Search for files by pattern.
- chmod +x script.sh: Gives execution permissions to scripts.
- chown: Change owner and group of files.
- tree: View the complete folder structure (requires installation with
pkg install tree). - head y tail: Show the first or last lines of files, useful for logs.
- unzip: Unzip ZIP files.
- tar -xf file.tar: Extracts tarballs.
Automation and scripting with Bash in Termux
Automate tasks and create scripts to manage your device:
- Create your script:
nano my_script.sh
- Make it executable:
chmod +x my_script.sh
- Run:
./my_script.sh
Simple example to display the date and list files in the home folder:
#!/data/data/com.termux/files/usr/bin/bash echo "Current date: $(date)" ls -lah $HOME
Include conditionals, loops, functions, and variables in your scripts for complex and custom tasks.
Advanced customization in Termux: aliases, prompts, colors, and more
Modification .bashrc to adjust the environment to your style and needs:
- Alias for frequent commands:
alias ll="ls -l --color=auto"
- Showtimes: for repetitive tasks.
- Color and customize the prompt, enable global history, and use colors in commands.
- To apply changes immediately:
source ~/.bashrc.

Text editing: Nano, Vim, and editors in Termux
To edit files, use:
- Nano: simple and very intuitive, ideal for beginners.
Example:nano archivo.txt - Vim: Advanced, powerful and configurable editor.
Example:vim archivo.txt
Remote management with SSH and SCP in Termux
Access and control your device remotely:
- Install SSH:
pkg install openssh - Generate SSH keys with
ssh-keygenfor secure connections. - Start the SSH server with
sshd(port 8022 by default). - From the PC, connect using:
ssh -p 8022 usuario@direccion-ip - Transfer files with
scp:
– Upload:scp archivo.txt usuario@ip:/destino/
– Download:scp usuario@ip:/origen/archivo.txt ./
Set up a web server in seconds with Python
To share files or do web testing:
pkg install python python3 -m http.server 8000
Accede to http://IP-del-móvil:8000 from any browser on the same network.
Redirect and browse anonymously with Tor and hidden services
Install and configure Tor:
pkg install tor
Thu
You can set up .onion services or browse anonymously, and you can also create tunnels with tools like ngrok to securely expose your services to the internet.
Automation with bots for Telegram and APIs
Develop Bash bots that interact with Telegram using curl and jq:
- Send notifications or receive commands from your device.
- Automate remote tasks, monitoring and control via chat.
- You only need the bot token, and the curl and jq tools (
pkg install jq curl).
Programming, compiling, and developing on your mobile
- Install compilers and environments:
pkg install clang gcc g++
pkg install python nodejs ruby php
- Work with Git to collaborate and manage code.
- Use make, cmake, and other tools to automate build and development.
Ethical hacking and security tools in Termux
- nmap: network scanning and auditing.
- Hydra: brute force attacks.
- sqlmap: database testing.
- openssl: encryption and TLS/SSL.
- netcat/ncat: Network and web services testing.
- tmux: managing multiple sessions in parallel.
Always do so responsibly and legally: use these tools in controlled environments and with explicit permission.
Shortcuts, tricks, and tips for Termux professionals
- Autocomplete with Tab.
- History with up/down arrows and Ctrl+R.
- Comment out lines in scripts with #.
- Set up servers and services, use ngrok to expose them, and manage processes with htop and tmux.
- Automate tasks with cron and at (
pkg install cronie).
Master Bash: Variables, Conditionals, Loops, and Functions
Learn to write dynamic and robust scripts:
- variables:
nombre="Juan" - Conditionals:
if [ "$edad" -ge 18 ]; then echo "You are of legal age" fi
- Loops:
for file in *.txt; do echo $file cat $file done
- Features:
greet() { echo "Hello $1" } greet "Manolo"
Network, HTTP, tunneling and service exposure
- curl, wget and ncat to test and send requests.
- ngrok to expose local servers to the internet without configuring ports.
- Tor for anonymous browsing and .onion services.
Security and good practices in Termux
- Make regular backups of important scripts and files.
- Do not run scripts from untrusted sources.
- Keep Termux and its packages up to date.
- Always review commands before executing them to avoid loss or damage.
- Respect the law and use tools responsibly.
Optimize your productivity: shortcuts, aliases, settings, and more
- Customize the prompt, add aliases, define functions and colors in ~/.bashrc.
- Use shortcuts like Ctrl+R to search for commands, arrows for history.
- Manage your scripts in folders like ~/bin or ~/scripts, and sync them with Git repositories.
- Automate tasks with cron or recurring scripts.
Complete Linux distributions on Android with proot-distro
Run Ubuntu, Debian, Kali and other distributions inside Termux:
- Installation:
pkg install root-distro
- List:
root-distro list
- Installing Ubuntu:
root-distro install ubuntu
- Access the distro:
proot-distro login ubuntu
From there, you can use apt, apk, dnf, or each distro's manager to install whatever you need, substantially expanding your phone's capabilities.
Additional useful resources and commands
- kill: kill processes by name.
- htop: monitor processes visually.
- top: lighter version of htop.
- grep: Search for patterns in files or output.
- awk: Analyzes and processes texts and columns.
- wc: counts lines, words and characters.
- tar: compress and extract files.
- unzip, gzip, bzip2, 7z: multiple compression format.
- sshfs: Mounts remote file systems via SSH.
- updatedb: Updates the database for fast searches with locate.
Frequently Asked Questions and Troubleshooting
- I can't access certain files or folders? Android limits access to certain routes. Use
termux-setup-storageand the routes in~/storage/. - How to troubleshoot permission issues? Review and adjust permissions with
chmodychown. - Why isn't Termux or its packages updated? Run
pkg update && pkg upgraderegularly. - Can I use a graphical environment? Yes, using VNC or X11, although it requires additional configuration.
Community resources and recommendations
- Save your scripts and configurations to GitHub or GitLab for syncing and backup.
- Explore repositories of scripts, tools, and dotfiles to improve your workflow.
- Participate in communities like GitHub, Reddit, and specialized Linux and Android forums to learn new tricks and answer questions.
- Stay up-to-date with the latest security packages, tools, and techniques.
How to learn and advance step by step
- Install Termux from F-Droid and update the packages.
- Grants storage permissions.
- Learn basic commands and explore the system structure.
- Customize your environment with aliases and scripts.
- Automate tasks, create scripts, and develop your own projects.
- Experiment with complete distributions and internet services.
Thanks to TermuxYour Android phone can become a powerful control, development, security, and automation center, allowing you to learn, work, and experiment in the vast Linux universe, all from the palm of your hand. Get started today and unlock your device's full potential.