Android is built on the Linux kernel, but the average user will not recognize it in any way. For example, an advanced Linux user would like access to a full-fledged console, but does not want to root the phone for this. Termux is the solution.
However, if you are used to the environment of a regular Linux distribution, you may also occasionally miss something similar on your phone. The possibility to solve a task simply with a regular line utility is very tempting. However, we lack basic software for this, which the GNU project provides for the regular system and which is not available in Android.
We can get it into the system if we root the phone, but not every user wants to do that. The Termux project offers a simple way to a Linux environment in Android .
Linux in one application;
From a user perspective, Termux is a regular Android app that you install from Google Play or the alternative F-Droid store . It has no special requirements, does not require system modification or anything like that. It is as easy to install as any other application.
It actually includes two different things: a terminal emulator and a complete command line environment. Upon first launch, it downloads a base environment containing 55 packages to its repository:
apt, bash, busybox, bzip2, ca-certificates, command-not-found, coreutils, curl, dash, diffutils, dos2unix, dpkg, ed, findutils, game-repo, gawk, gpgv, grep, gzip, inetutils, less, libandroid-glob, libandroid-support, libbz2, libc++, libcrypt, libcurl, libgcrypt, libgmp, libgpg-error, libiconv, liblzma, libmpfr, libnghttp2, libutil, ncurses, net-tools, openssl, patch, pcre, procps, psmisc, readline, science-repo, sed, tar, termux-am, termux-exec, termux-keyring, termux-licenses, termux-tools, unzip, util-linux, xz-utils, zlib
As you can see, this is actually the basis of the Linux distribution, we can find the packaging system, a basic set of common utilities and mainly busybox. This is a universal utility that can perform dozens of different commands. It behaves according to what name we call it. In this way, it can work as ls, ps or perhaps grep.
So we have a basic working system that we enter simply by launching the Termux application on Android. This gives us a pretty well done terminal emulator. In it, we can choose the font, color, copy and paste text, open multiple terminal sessions or add our own bar with additional keys to the keyboard. But the important thing is inside.
It lives!
The entire "Termux Linux distribution" lives in the system directory /data/data/com.termux/files/. There you will find installed software, configuration files and user data. All software in Termux is modified for this special condition, so it allows for other paths.
At the same time, you do not have any other user accounts available here. Everything runs under that one user, like the application itself. It behaves the same as if you were still root in Termux. You can install packages, write to all files and easily delete the entire environment with one command. In this space, you are the master, not Android.
It is understandable that some things are different here. In addition to the mentioned paths , for example, you will also not get to low TCP/UDP ports. The packages take this into account and use ports like 8021, 8022 or 8080 by default. You also don't have the option to influence the system configuration of course, so forget about editing files in the real /etc/. You will have to make do with the configuration inside the writable storage.
Packages here;
Standard APT is used as the packaging system, which you know from Debian or Ubuntu, for example. There are more than a thousand packages available, the source codes of which can be found on GitHub . Editors, programming languages, servers, network utilities and more are available. In addition, the number of packages continues to grow.They are signed by the Termux developers and there are also three official additional repositories:
- termux-root-packages contains packages requiring system root
- x11-packages offers graphical desktop applications
- unstable-packages, on the other hand, groups development or broken packages
Integration with the system;
Termux has the option to also access data originally belonging to Android. This is done by a utility termux-setup-storagethat calls the system API with a request to add the appropriate permission. If the user agrees to the request, several symlinks will be created in the Termux home directory:
- shared – a directory shared between applications
- downloads – files downloaded by the browser
- dcim – directory with photos and videos
- pictures – image storage
- music – music for players
- movies – videos for players
- external – card (if present)
Thus, when accessing them, we can work with files that we have obtained from other applications. For example, we download a compressed archive, unzip it in Termux, delete it, pack it and send it away again with another Android application.
Termux also offers several optional add-ons that allow you to go even further and, for example, call the Android API from scripts or, conversely, run scripts directly from the Android environment. Extensions available as standalone Android apps:
- Termux:API - Access the Android API from Linux
- Termux:Boot – runs scripts after Android starts
- Termux:Float – terminal in a floating window
- Termux:Styling - color schemes and fonts
- Termux:Tasker - ability to call commands from Tasker (and compatibles)
- Termux:Widget - trigger actions from the Android screen
0 Comments
Please don't enter any spam link in the comment box.