0% found this document useful (0 votes)
292 views

How To Use The Linux Command Line On Android With Termux

Jow to use linux command line

Uploaded by

wira li
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
292 views

How To Use The Linux Command Line On Android With Termux

Jow to use linux command line

Uploaded by

wira li
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

PC & MOBILE LIFESTYLE

Advertisement
ANDROID, LINUX Christian Cawley
How to Use the Linux 1363 articles

Command Line on Deputy Editor for Security, Linux, DIY,


Programming, and Tech Explained. He a
Android With Termux produces The Really Useful Podcast an
extensive experience in desktop and so
support. A contributor to Linux Format
magazine, Christian is a Raspberry Pi tin
By Christian Cawley / Updated December 2, 2019 02-12-2019 Lego lover and retro gaming fan.
Android is a capable operating system, as it offers many
apps that approach desktop class. Yet sometimes, it takes Advertisement
a fair bit of effort to accomplish something on Android that
would be a snap on a desktop.
Advertisement

One solution is to take advantage of Android’s hidden


Linux infrastructure. The Termux app provides a command
line environment and allows you to install honest-to-
goodness Linux apps on your Android device. Here’s how
to use the Termux app.
Trending Now
Why Use Termux? How to Get Windows 10
Free or Cheap
by Tina Sieber
There are already some apps in the Play Store that are The Best Free Movie
Android ports of Linux applications. These differ from Streaming Sites
Termux in that they replicate those Linux apps, but they’re by Ben Stegner
made in an “Android way.” Yes, Get Microsoft Word
Free: Here’s How
In contrast, Termux is a self-contained Linux environment. by Mihir Patkar
Its programs are (for all intents and purposes) the same as Top 4 Unbiased World N
their Linux counterparts. This conveys some advantages Sources Free From
over the ported applications: Censorship
by Gavin Phillips
Consistency: Linux apps that have been ported to How to Watch Netflix Wi
Friends Far Away: 7 Meth
Android require a user interface of some kind. The That Work
user experience on Android largely depends on how by Dan Price
much effort the developer puts into it. Conversely,
Termux apps are the same as the Linux versions, from New PC? 15 Must-Have
keyboard shortcutsPCto&how
MOBILE
you installLIFESTYLE
them. Windows Applications Y
Should Install First
Compactness: The addition of Android code can by Ben Stegner
cause some slim applications to become heavy. For 100% Disk Usage in Win
Advertisement

example, an Android SSH client might be anywhere 10 Fixed With 15 Tricks


by Christian Cawley
from 2MB to 12MB in size. Compare this to Dropbear, 5 Powerful Alternatives
available in Termux, which weighs in at 396KB (that’s the Windows Task Mana
Advertisement

kilobytes) installed. And it provides an SSH server too. by Gavin Phillips


Get a Linux command line on Android with Termux Latest Giveaways!
Timeliness: When an application receives an update, Is the Vankyo Performan
you remain at the mercy of the Android app’s V630 a Smart Budget LC
developer for an upgrade. In contrast, Termux Projector for Your Home
Theater?
applications are standard Linux packages that require by Christian Cawley
less maintenance. They may even be created Flic 2 Review: The Ultima
automatically alongside the desktop versions. You’re Smart Button That Integ
likely to get access to new features more quickly with Anything With a Web AP
by James Bruce
Termux. Don’t Buy a Gaming Keyb
Price: There is a chance any app you purchase from Until You’ve Seen The
the Play Store will have a charge associated with it. All Azeron! (Review and
Giveaway)
the apps in Termux are free (and open source), as is by James Bruce
Termux itself. Retroflag GPi is the Ultim
Portable Retro Gaming
How to Use Termux Console
by Christian Cawley

Before diving in, understand that Termux is primarily a


Advertisement

command line environment. There’s no fancy user


interface with shiny buttons here. This goes not only for
the base Termux package, but its apps as well. You won’t Latest Videos
get the newest version of LibreOffice with this method.
Advertisement

SNES Music Trivia (S1 E7

Most importantly, you must be comfortable with the


command line in order to install and use these programs
on Termux. To develop some familiarity, check our list of
PC & MOBILE
the most-used Linux Terminal commands.LIFESTYLE

40+ Most Used Linux Terminal


Advertisement

Commands
Whether you're just getting started or simply Pokemon Gen 1 Trivia (S1 E
curious about the Linux terminal, here are the
most common commands that will carry you
through your entire time on Linux.
Read More

When you’re ready, grab your phone or tablet and install


Termux.
Download: Termux (Free) Vankyo V630: The Budge
Projector for You? (Mayb
Basic Termux Commands You
Should Know
Launching Termux will drop you straight into a command
line environment. From here, you can install new tools.
Termux uses the same package installer as found in
Debian, Ubuntu, and related Linux distros. Best Cross-Platform Mob
Advertisement Games to Play With Frien

How to Find Books Witho


The Title
Advanced Packaging Tools (more commonly referred to as
APT) is used to find, install, and remove software in
Termux. Start off by updating packages and upgrading
with these commands: Advertisement

Latest Deals
apt update

Flic 2 Smart Buttons: Press


apt upgrade Do Anything!
Update packages
PC in& the Termux command
MOBILE LIFESTYLEline
Next, find out what apps are available:
Advertisement

apt list

To find out more about one of these packages, use


Advertisement

Replay

apt show [package name]

This will display the name, maintainer, file size,


dependencies, and other useful details. To install an app,
simply use:
apt install [package name]

Our guide to using APT will tell you more about this tool,
such as how to upgrade packages. You can run an
installed tool by entering its name at the Terminal prompt
in the Termux command line.

A Beginner's Guide to Installing


Software in Ubuntu with APT
If you've used Ubuntu you have probably used the
apt command at some point. But did you know
there's so much more to it than apt-get install and
apt-get upgrade?
Read More

In addition to apt, this list of built-in commands works in


Termux on Android:
cp lets you copy aPCfile& MOBILE LIFESTYLE
mv will move a file

ls lists the contents of a directory Advertisement

rm deletes (removes) data

ln creates a symbolic link (for example, ln


/data/data/com.termux/files/home/documents
to /sdcard/Documents )
With these built-in tools, you reduce the need for an
Android file manager. They also save you from having to
root your phone to enjoy such functionality.
Advertisement

Linux Apps You Can Install With


the Termux Command Line
Using apt with Termux, you can install several useful Linux
apps on Android. These fall into several categories—let’s
look at some of the highlights.
Text Editors
Termux provides recent versions of both popular Linux text
editors: VIM and Emacs. Other editors, such as the
minimalist nano, are also available.
Of course, Android has a lot of text editors already. So
what do Emacs and Vim bring to the platform? Well, if you
like to work in Markdown, both support it well. Into the
“distraction-free” mindset? It doesn’t get much more
distraction-free than VIM—check out our VIM shortcuts
cheat sheet for help mastering it.
CheatPCSheet:
& MOBILEThe Vim Linux
LIFESTYLE
Command Line Editor Cheat
Sheet Advertisement
Keep this Vim cheat sheet handy to learn or
relearn useful Vim commands.
Read More

Need something to take notes and provide to-dos? Org-


mode in Emacs has you covered. You can even use Emacs
as your file manager, screenwriting app, Trello client,
music player, or to play Minesweeper.
Advertisement

Why switch? Android text editors tend to focus on one


standout feature. For example, one may focus on
distraction-free drafting, another can preview Markdown
and other formatting, and still others might be built on
keeping notes (though they’re really just text editors at
their core).
Terminal-based editors can fulfill these needs in a single
program, while also being available on desktop platforms.
Termux Command Line Utilities
Termux packages include several useful Linux command
line utilities:
gnuplot: A mathematical graphing program
ImageMagick: An image manipulation and conversion
toolkit
p7zip: An archiving utility for the 7-Zip compression
scheme
UnRAR: A differentPCarchive tool for theLIFESTYLE
& MOBILE RAR format
Wget: A program to fetch files over the internet via
HTTP or FTP Advertisement

Why switch? These are dedicated programs with a lot to


offer.
Install Servers in Termux
We’ve already shown how you can turn your Android
device into a web server with specific apps. Termux
similarly provides genuine Linux web servers like Apache,
nginx, and Lighttpd.

How to Turn an Android Device


Into a Web Server
Want to host a simple website without an
expensive hosting plan? Here's how to host a
website on your Android phone or tablet.
Read More

But why would you want to run a web server on your


Android device?
In addition to programming, bear in mind that many of
today’s best applications are web apps. For example, you
could install nginx, the PostgreSQL database, and Python,
then use the Taiga project management platform. This is a
lot of utility, all without having to sign up for any third-
party services or hosting.
Termux also includes Dropbear, which provides an SSH
server (and client) to log into your phone/tablet and
transfer files. This is useful in situations where you want to
exchange a few files but don’t want to use cloud services.
Simply start up the Dropbear server, use an SSH client to
grab what you need, and shut it down.
Why switch? Apps like Tiny Web Server allow you to spin
up a web server. But what’s more intriguing than having a
lightweight server you can start from the command line?
Development Apps in the Termux
Command Line
While many Android apps (listed as “code editors”) provide
the ability to write code,PCthey
& MOBILE LIFESTYLE
may not provide the
languages themselves. With Termux, you can test your
code on your phone or tablet. Advertisement

Install Python development tools in the Termux


command line
It offers standard distributions of programming languages
such as:
BASH shell (the default available out of the box, and a
great way to get started hacking around)
Python (both v2 and v3 are available)
PHP
Ruby
Source control systems git and Subversion are also
available, which have their uses beyond just development.
If you like being in control of your own data, source control
lets you stash your files wherever you want. You also
control when you send updates to other devices, and can
use “tags” to label versions.
Why switch? There are some programming language
packages for Android, such QPython. But these provide
their own bulky UIs. They may also require additional apps
to be fully useful.
Android-based apps are available for both git and svn.
However, you need to have a separate app for each source
control type. Termux provides both in the same package
for free. By going with source control, you can also cut
down on clients for cloud syncing services such as
Dropbox.
Add Linux to Android With
Termux Commands
Termux is a super-compact offering that opens a lot of
functionality for your Android device. The command line is
one of the most powerful features of Linux, and Termux
builds on your device’s Linux kernel to make you more
efficient on the go.
And who knows, maybe dabbling with these apps will
PC on
convince you to try Linux & MOBILE
the desktopLIFESTYLE
as well. Check
out our Linux commands cheat sheet for some help giving
it a try. Advertisement

The Linux Commands Reference


Cheat Sheet
This simple cheat sheet will help you get
comfortable with the Linux command line terminal
in no time.
Read More

Explore more about: Android, Linux, Linux Commands, Terminal.


Affiliate Disclosure: By buying the products we recommend, you help
keep the site alive. Read more.

Email Facebook Pinterest Twitter

Enjoyed this article? Stay


informed by joining our
newsletter!
[email protected] Submit
Read our privacy
policy

8 COMMENTS WRITE A COMMENT


PC & MOBILE LIFESTYLE

Advertisement

Raspberry Pi Terminal Commands: A Quick Guide for Raspberry Pi Users

How to Run a Linux Desktop Using the Windows Subsystem for Linux

How to Run Linux on Android Devices

6 Fun and Cool Mac Terminal Commands to Try


How to Install
PC & MOBILE
Android on a Raspberry Pi
LIFESTYLE

Advertisement

How to Run Windows Apps on Android With Wine

The Best Linux Operating Distros

9 Raspberry Pi Operating Systems That Aren’t Linux

© 2020 MakeUseOf. All Rights Reserved.

You might also like