How to use the Linux command line on Android with Termux
Android is a very capable operating system with more and more desktop access applications, but sometimes you want to do something on Android that can be as easy as a desktop computer.Fortunately, you can use Termux, it builds on an existing infrastructure and provides a command line environment that allows you to install real Linux applications on your Android device.
Why use Termux?
In fact, there are some apps in Play Store that convert Linux applications into applications on Android.Unlike Termux, these applications make copies of Linux applications and 'Androidize' them.In contrast, Termux is a standalone Linux environment.Its programs (for all purposes) are exactly the same as Linux copies.This gives it some benefits that conversion applications don't have:
- Consistency - Linux applications that have been switched to Android must receive some kind of user interface.The user experience on Android depends very much on the efforts of those application developers.It is different in many cases.However, Termux applications are like Linux versions, from shortcuts to how you install them.
- Compact - Adding the "Android code" described above can cause problems for some applications.For example, the SSH client application on Android (the VX ConnectBot application shown below) is useful. However, except for some graphics screens, you still have to use the application in the command line interface as shown below, when compared to Dropbear available in Termux, it only heavy 396 KB (you should note that this is a non-MB KB), this SSH client is much more powerful and Dropbear also provides an SSH server to boot.
- Properties in time - When the application is updated, you still have to wait for Android application developers to upgrade it.In contrast, Termux applications are relatively standard Linux packages, requiring less work.It can even be created automatically with desktop versions.You can access new features faster with Termux.
- Prices - Of course, the apps you buy from Play Store while using will incur related costs, but all applications in Termux are free.
Download : Termux (free)
Use Termux
Before starting to learn how to use Termux, you need to be aware that Termux is a command line environment, it doesn't have a fancy user interface with buttons like you often see in Linux conversion applications. Other Android.
This is not only for basic Termux packages but also for its applications.You will not receive the latest version of LibreOffice.You need to have a certain understanding with the command line to install and use these programs.
However, the program installation process is quite simple.Termux uses the same package installer available in Debian and Ubuntu Linux, called Advanced Packaging Tools (APT) .To see what applications are available, open Termux and type the following command:
apt list
You will then see a list of all the packages or software packages you can install.If you want to see details about a particular software just type this line and replace the word in square brackets with the application name:
apt show[ten cavalier]
It will display a brief summary of the package.The image illustrated above is the Emacs text editor application.Finally, to install, just type this command into:
aptinstall[ten cavalier]
After installation is complete, you can start the program by typing its name at the command prompt.The screenshot below shows the text editor application running after installation.
Now let's see some great utilities you can get through Termux.
Basic Linux utilities
This application will allow you to use basic Linux utilities to perform operations such as copying (cp command), moving files (mv commands), reading directory contents (ls command) and deleting ( command rm).
Nothing is you can not do with Android file management tool right?Yes, so is Termux, it contains the "link"command(ln).Termux is in the/data/data/com.termux/files/homedirectory, this is not the place to store your remaining files (usually / sdcard).But you can create new symbolic links in this directory (eg/data/data/com.termux/files/home/documentsto/ sdcard / Documents).
This will allow you to quickly navigate to those files.
File management commands in Termux can basically reduce the need to use separate file management tools unless they have additional features.The ability to create links between folders can also remove applications like Link Folder and it will save you time to root your phone to get this function.
Text editing application
Termux provides recent versions for both major Linux text editing applications: VIM (v8.0, new and stable when writing) and Emacs (v25.2).The images below compare Emacs running in the terninal konsole command window interface on Linux (above image) and on Termux (pictured below).Notice the similarities.
Now, Android has a lot of similar text editing applications.And one of them does a good job of saving and opening text files, but some other applications don't have so many functions.
Emacs and VIM are great text editing applications.You can even use Emacs as a file management tool, script writing application, Trello task management tool, music player or to play Minesweeper.
Android text editors often have a key feature, with applications focused on compiling according to distraction-free mode, with apps that can preview Markdown or other formats, and have apps just for notes .The terminal-based editors above can meet these needs in a single program and it is available on desktop platforms.
Command line utility
The Termux package includes some useful Linux command line utilities:
- Gnuplot- a mathematical drawing program
- Imagemagick- a set of conversion and image editing tools
- P7zip - storage / decompression utility
- Unrar - a RAR format decompression tool
- Wget - a program to retrieve files on the internet via HTTP or FTP
Usually if you need to perform the above functions, you will need separate standalone applications.Depending on the number of functions you need, even if an application handles all of the above storage formats and graphics, you still have to download some applications on your device.However, with the Termux package, you just need to run the above command line utilities to implement and they are really useful.
- 10 most useful Linux commands
- Anyone should know these basic Linux commands
Server
Termux provides Linux web servers such as Apache and lighttpd.
Why do you want to run a web server on your Android device?In addition to programming, there are many applications today that are web applications.For example, if you are looking for a project management application that runs on your device, the "root" Android options seem a bit less.However, you can installnginx- PostgreSQL database, Python and use Taiga without having to register for a third party service or hosting service.
Dropbear in Termux provides an SSH server to log in to your phone / tablet and transfer files to a client. This is useful in case you want to exchange some files with another machine that doesn't want to use cloud services or doesn't want or can't install the driver to plug directly into the device. You can start the dropbear server for a while, use a client on Windows or MacOS, get what you need online and turn it off.
Applications such as free PAW servers or paid Ulti servers allow you to run a web server.
Program
Although many Android applications provide the ability to write code, they do not provide language.With Termux you can check that code right on your device.It provides standard distributions of programming languages such as:
- BASH shell
- Python (both v2 and v3 are available)
- PHP
- Ruby
Git and Subversion source control systems are also available, their applications are not just for programming.If you want to control your data, source control lets you store files wherever you want.You can also control when you send updates to other devices and use "tags" for label versions (like "mydocument_v12_Aaron's_edit_final_for_real_the_last_one.DOCX").
There are several programming language packs for Android, such as PHP, QPython or Pocket Ruby.But they provide a "cumbersome" user interface and may require other applications to have full utilities (such as Apache-based servers must be included with PHP).There are Android-based applications for both git such as Pocket and svn likeOpen Android SVN Pro.However these two applications are not free and you need to have a separate application for each type of source control.Termux offers both in one free package.By controlling the source code, you can also cut down the client for cloud synchronization services like Dropbox.
Termux is an extremely compact application, which opens up a lot of features for your Android device.The command line is one of the most powerful features of Linux and Termux is built on the kernel of the device to help you perform more efficiently.
You should read it
- 12 things Linux is easier to do in the command line than graphical software
- How to copy (and paste) files and folders from the Linux command line
- 14 interesting Linux commands in Terminal
- How to use the which command in Linux
- The dd command in Linux, How to use the dd command
- Instructions for using find command in Linux
- How to schedule Linux commands with 'at'
- 5 reasons why people love the Linux command line
- How to check whether a Linux PC is 64-bit or 32-bit by command line
- How to Launch Programs from Command Line on Linux
- The Cat command in Linux
- 20+ essential Linux security commands
Maybe you are interested
Why is there no professional mode on Facebook?
6 ways to fix the error 'PowerPoint found a problem with the content'
The Dark Web is not illegal, but be wary of these 7 things!
YouTube is about to support a feature that allows creators to reply to viewers' comments with their voice
9 ways to fix the error of not being able to save files as JPEG or PNG in Photoshop
Apple's 'shot on iPhone' ads don't reflect the truth