Start here / เริ่มตรงนี้
Termux is a terminal app that gives Android a Linux-like command line. Type commands at the prompt and press Enter.
Termux คือแอปเทอร์มินัลที่ทำให้ Android ใช้งานคำสั่งแบบ Linux ได้ พิมพ์คำสั่งที่บรรทัดพร้อมรับคำสั่งแล้วกด Enter
command [options] [arguments]
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.
เปิด Termux คุณจะเห็นบรรทัดพร้อมรับคำสั่ง ซึ่งมักลงท้ายด้วย $ พิมพ์คำสั่งต่อท้ายแล้วกด 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
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
Simple text editor
pkg install nanoPython interpreter
pkg install pythonManage code projects
pkg install gitFetch web resources
pkg install curl wgetRead and format JSON
pkg install jqShow folder structure
pkg install tree04 · 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.
ชื่อแพ็กเกจอาจไม่เหมือนชื่อคำสั่งที่ใช้จริง ใช้คำสั่งเหล่านี้เพื่อตรวจสอบเครื่องมือที่มี
| Command | What it tells you |
|---|---|
pkg list-installed | Installed Termux packages |
command -v tool | Where a command is found |
which tool | Path to a command, if available |
type tool | Alias, builtin or executable |
tool --help | Usage and options |
compgen -c | Commands 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
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.
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.txtRead 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 / แก้ปัญหาเบื้องต้น
Run
pkg update, check spelling, then pkg search name.Check
pkg list-installed. The executable name may differ from the package name.Check Android permissions and file location. Shared storage has restrictions.
Try
termux-change-repo, choose a reliable mirror, then update again.Usually press
Ctrl + C. Termux extra keys may provide Ctrl.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