What is Termux? A Beginner's Guide to Termux

Hey everyone, I was planning to write my next article—which I mentioned in my previous post about “How to Customize the Vim Editor on Termux to Make It Look Like VSCode.” That’s when I thought: how many people actually know about Termux and how to use it? If you're one of them, this article is for you. Before diving into Termux commands, let's talk about what Termux is.
What is Termux?
Termux is a free and open-source terminal emulator for Android that provides a Linux environment without the need for root access. If your device is rooted, it becomes even more powerful, allowing you to use additional tools such as chroot
. In simple terms, it transforms your Android device into a mini Linux workstation, enabling you to install extra Linux packages via its package manager (which is based on Debian’s APT).
Termux gives you access to most standard Linux commands and shells, allowing you to run scripts, compile code, and more. With Termux, you can install tools for programming (e.g., Python, JavaScript, Java), networking, security, and text editing (e.g., Vim, Nano, Emacs).
Beyond the basic terminal, Termux supports add-ons like Termux:API, Termux:Styling, and Termux:Boot, and you can install packages like OhMyZsh.
You can download Termux via
F-Droid
or directly from
GitHub.
I personally prefer the GitHub version because it's the most updated version available. You can also download it from the Play Store, but don't install it because the Play Store version is no longer actively maintained and, due to new security policies (Android 10 onward), it faces compatibility issues.
Overall, Termux is a powerful tool for developers or anyone who wishes to become a software developer but doesn't have access to a computer.
Now, let’s dive into Termux commands.
Basic Package Management
Update and Upgrade
Every time you open Termux, make sure your terminal is up-to-date by updating and upgrading it before use.
-
Update Package List:
Updates the package list from the Termux repositories.pkg update apt update
-
Upgrade Packages:
Upgrades all installed packages to their latest version.pkg upgrade apt upgrade
-
Combine Update and Upgrade:
Alternatively, you can combine both commands in a single line.pkg update && pkg upgrade
Installing and Searching for Packages
-
Install a Package:
Installs a package (e.g.,pkg install <package>
pkg install python
). -
Search for a Package:
Searches for packages matching the keyword.pkg search <keyword>
Standard Linux File Management
These are the same commands you’d use on any Linux system:
ls
- List files and directoriescd <directory>
- Change the current directory (this command takes you inside a specific directory)mkdir <dir>
- Create a new directory (e.g.,mkdir my-project
)cp <source> <destination>
- Copy files or directories (e.g.,cp files.txt home/my-folder
)mv <source> <destination>
- Move or rename files/directories (e.g.,mv files.txt home/my-folder
ormv app.py application.py
)rm <file name>
- Remove a file (deletes a file). Userm -r
for directories.cat <file name>
- View file contentsnano <file name>
orvim <file name>
- Edit file contents
Termux-Specific Commands
Storage and Repository Management
-
Set Up Storage:
Prompts you to grant Termux permission to access your device’s storage.termux-setup-storage
-
Change Repository:
Allows you to change the package repository mirror for faster downloads. Select a repository mirror based on your nearest location.termux-change-repo
Power and System Info
-
Prevent or Allow Sleep:
Prevents or allows the device to sleep while Termux is running.termux-wake-lock termux-wake-unlock
-
Display System Info:
Displays detailed information about your Termux installation environment.termux-info
Clipboard and Notifications (requires termux-api package)
-
Set or Get Clipboard Content:
Retrieves or sets the Android clipboard content.termux-clipboard-set termux-clipboard-get
-
Open a File or URL:
Opens a file or URL with an appropriate app on your device.termux-open <file or url>
Multiplexing and Process Management
-
Start a Terminal Multiplexer Session:
Useful for running multiple tasks simultaneously.tmux
-
Interactive Process Viewer:
An interactive process viewer.htop
Termux Add-ons
These are not commands, but apps you can install via F-Droid to expand Termux's capabilities:
- Termux:API – Integrates Android functions into the CLI.
- Termux:Styling – Lets you change fonts and colors.
- Termux:Boot – Runs commands automatically at device startup.
- Termux:Widget – Integrates Termux scripts with home screen widgets.
- Termux:Tasker – Integrates Termux scripts for automation.
I discovered a new add-on on F-Droid while researching for this article—a plugin for Termux that enables an Android GUI for terminal applications. I haven't tested it yet, but it sounds interesting. If you want to check it out, click here.
Conclusion
These are the basic Termux commands you need right now. With these commands, you can interact with Termux and browse the internet. As you explore, you'll surely find more interesting Termux commands. By the way, with Termux you can do more than just simple tasks—you can install popular distros like Ubuntu, Debian, Arch, Kali Linux, etc. You can even run a virtual desktop and customize it as your own. That’s all I want to share with you today. If you like my article, please leave a comment—whether it's criticism or appreciation—as it would mean a lot to me and help me improve.
Comments
Post a Comment
Please drop an appreciation or criticism 🙂💗