Your pocket Linux playground

TERMUX NEON LAB

A practical beginner guide to Termux: commands, packages, discovering installed tools, files, networking and Python. English + Thai.

Start here / เริ่มตรงนี้

Termux is a terminal app that gives Android a Linux-like command line. Type commands at the prompt and press Enter.

command [options] [arguments]
Beginner rule: Read commands before running them. Never run an unknown script just because someone promises a shortcut or a fix.

Switch language using the button above. Command examples stay unchanged.

01 · First steps / เริ่มต้นใช้งาน

Open Termux. You will see a prompt, often ending in $. Type after it and press Enter.

whoami
pwd
date
uname -a

whoami shows your username; pwd shows your current folder; date prints date/time; uname -a displays system details.

Get help

command --help
man command

Replace command with the tool name. Not every package has a manual page. Press q to exit many manual viewers.

02 · Update Termux / อัปเดต Termux

Refresh package information and upgrade installed packages before installing tools.

pkg update
pkg upgrade

Type y and press Enter if asked. Or run both in one line:

pkg update && pkg upgrade
Install Termux from a trusted source such as F-Droid or official Termux GitHub releases. Avoid mixing add-ons signed by different sources.

03 · Install and manage packages / ติดตั้งและจัดการแพ็กเกจ

Install packages

pkg install nano
pkg install python git curl wget -y

-y automatically confirms prompts. Leave it off if you want to review before accepting.

Search, inspect and remove

pkg search keyword
pkg show package-name
pkg list-installed
pkg uninstall package-name

Example: pkg search speedtest. Package names and availability can vary by repository.

Useful starter tools

nano
Simple text editor
pkg install nano
python
Python interpreter
pkg install python
git
Manage code projects
pkg install git
curl / wget
Fetch web resources
pkg install curl wget
jq
Read and format JSON
pkg install jq
tree
Show folder structure
pkg install tree

04 · Discover installed tools and commands / ค้นหาเครื่องมือและคำสั่ง

A package name is not always the same as the command it installs. Use these to discover what is available.

CommandWhat it tells you
pkg list-installedInstalled Termux packages
command -v toolWhere a command is found
which toolPath to a command, if available
type toolAlias, builtin or executable
tool --helpUsage and options
compgen -cCommands known to Bash

List executable command names

printf '%s\n' "$PATH"
ls "$PREFIX/bin" | sort

Termux packages normally put executable commands in $PREFIX/bin.

Find which package owns a command

command -v curl
dpkg -S "$PREFIX/bin/curl"

If the path differs, replace the example path with the result from command -v.

List files installed by a package

dpkg -L package-name

05 · Files and Android storage / ไฟล์และพื้นที่เก็บข้อมูล

Allow access to shared storage

termux-setup-storage

Approve Android's permission prompt. Shared storage shortcuts usually appear under ~/storage/.

Move around

pwd
ls -lah
cd ~
cd ~/storage/shared
mkdir practice
cd practice

Create, copy, move and delete

touch notes.txt
nano notes.txt
cp notes.txt notes-copy.txt
mv notes-copy.txt archive.txt
rm archive.txt
Careful with deletion: rm removes files. Check pwd and ls first. Avoid rm -rf unless you fully understand the target.

06 · Network tools / เครื่องมือเครือข่าย

Install common network diagnostic tools:

pkg install net-tools dnsutils curl wget iproute2

Try them

ifconfig
ip addr
ip route
ping -c 4 1.1.1.1
nslookup example.com
dig example.com
curl -I https://example.com

ifconfig/ip addr show interfaces; ip route shows routes; ping tests reachability; nslookup/dig query DNS; curl -I requests response headers.

Android may restrict low-level network information. Some commands show limited results without root access. That is normal.

Install speedtest-cli

pkg install python
python -m pip install speedtest-cli
speedtest-cli

If the command is not found, check the pip installation output and try python -m speedtest if supported by the installed package version.

07 · Python and Git / Python และ Git

Python quick check

pkg install python
python --version
python

At the Python prompt, try print("Hello from Termux"). Type exit() to leave Python.

Run a Python file

nano hello.py
python hello.py

Put this line in the file: print("Hello from Termux").

Git basics

pkg install git
git --version
git clone https://github.com/OWNER/REPOSITORY.git
cd REPOSITORY

Replace the sample URL with the real project address. Read the README and inspect scripts before running them.

08 · Processes and system information / ตรวจสอบโปรเซสและระบบ

top
ps -ef
df -h
du -sh .
free -h

top shows running processes (press q to quit); ps lists processes; df shows filesystem space; du estimates folder size. free may be unavailable or limited on Android.

09 · Make a tool inventory / สร้างรายการเครื่องมือที่ติดตั้ง

Save a report of installed packages, executable commands and system details:

mkdir -p ~/termux-report
{
  echo "TERMUX TOOL INVENTORY"
  date
  echo
  echo "== SYSTEM =="
  uname -a
  echo
  echo "== INSTALLED PACKAGES =="
  pkg list-installed
  echo
  echo "== COMMANDS IN PREFIX/BIN =="
  ls "$PREFIX/bin" | sort
} > ~/termux-report/inventory.txt

Read or edit the report:

less ~/termux-report/inventory.txt
nano ~/termux-report/inventory.txt

To copy it to Android's Download folder (after termux-setup-storage):

cp ~/termux-report/inventory.txt ~/storage/shared/Download/

10 · Troubleshooting / แก้ปัญหาเบื้องต้น

Package not found
Run pkg update, check spelling, then pkg search name.
Command not found
Check pkg list-installed. The executable name may differ from the package name.
Permission denied
Check Android permissions and file location. Shared storage has restrictions.
Repository errors
Try termux-change-repo, choose a reliable mirror, then update again.
Stop a command
Usually press Ctrl + C. Termux extra keys may provide Ctrl.
Clear the screen
Run clear or press Ctrl + L.

Everyday cheat sheet

clear                 # clear terminal
history               # show command history
!!                    # repeat previous command
exit                  # close current shell
pkg search NAME       # search packages
pkg install NAME      # install a package
pkg uninstall NAME    # remove a package
command -v NAME       # locate a command
NAME --help           # show help
Use network diagnostics only on your own devices and networks or where you have explicit permission. Do not scan, access or interfere with other people's devices or networks.