The terminal emulator is basically an application that launches the command line program by using system call execve and redirecting standard input, output and error streams onto the display.

Most terminal applications available on Android OS work with a very limited set of utilities which are usually provided either by the operating system or other rooting tools such as Magisk. We have decided to go further and port common software usually available on GNU/Linux systems to Android OS.

Termux is neither a virtual machine nor any other kind of emulated or simulated environment. All provided packages are cross-compiled with Android NDK and only have compatibility patches to get them working on Android. The operating system does not provide full access to its file systems, so Termux cannot install package files into standard directories such as /bin, /etc, /usr or /var. Instead, all files are installed into the private application directory located at

/data/data/com.termux/files/usr

We call that directory "prefix" and usually refer to it as "$PREFIX" which also an exported environment variable in the Termux shell. Note that this directory cannot be changed or moved to an SD-Card because:

  • The file system must have support for unix permissions and special files such as symlinks or sockets.
  • The prefix path is hardcoded into all binaries.

In addition to prefix, users can store files in the home directory (or "$HOME") available at

/data/data/com.termux/files/home

However, the file system is not the only difference from the traditional Linux distributions.