Termux Commands List 2026: Complete Guide From Basic to Advanced (With Examples)
So you just downloaded Termux. You opened it. A black screen with a blinking cursor stared back at you — and you had no idea what to type next.
Yeah, we've all been there.
Termux is honestly one of the most powerful apps you can put on your Android phone. It turns your phone into a real Linux machine — no root required, no complicated setup, just pure command-line power sitting in your pocket. But if you don't know the commands, it's just a fancy black screen.
That's exactly why I wrote this guide. Whether you just installed Termux five minutes ago or you've been poking around for a while but still feel lost — by the end of this post, you'll know every important Termux command and actually understand what each one does.
Let's get into it.
What Exactly Is Termux? (Quick Explanation)
Termux is a free Android app that gives you a full Linux terminal on your phone. You can install real Linux tools like Python, Git, Nmap, and hundreds of others — all without rooting your device.
People use Termux for all kinds of things: learning to code, automating tasks, ethical hacking practice, web scraping, running servers — you name it. If you can do it on a Linux machine, there's a good chance you can do it on Termux too.
One important note before we start: Don't install Termux from the Google Play Store anymore. That version is outdated and abandoned. Instead, download it from F-Droid — it's free, safe, and always up to date.
First Things First — Run These Commands Right After Installing
Before you do anything else in Termux, run these two commands. Think of it like charging your phone before using it. Skip this and you'll run into weird errors later.
pkg update
pkg upgrade
The first command refreshes the list of available packages. The second actually installs any updates. When it asks you "Do you want to continue? [Y/n]" — just type Y and hit Enter.
Then run this one too:
termux-setup-storage
This gives Termux permission to access your phone's storage — your Downloads folder, SD card, etc. A permission popup will appear. Tap "Allow." Done.
Termux Basic Commands — Start Here
These are the commands you'll use every single day. Learn these first before anything else.
Navigation Commands
pwd — Stands for "Print Working Directory." It tells you exactly where you are right now.
pwd
Output will look something like: /data/data/com.termux/files/home
ls — Lists all files and folders in your current location.
ls
Want to see hidden files too? Add the -a flag:
ls -a
Want more details like file size and permissions?
ls -la
cd — Changes your directory (moves you to a different folder).
cd Downloads
Go back one folder:
cd ..
Go straight to your home directory from anywhere:
cd ~
File and Folder Management
mkdir — Creates a new folder.
mkdir MyProjects
touch — Creates a new empty file.
touch hello.txt
cp — Copies a file from one place to another.
cp hello.txt backup.txt
mv — Moves or renames a file.
mv hello.txt renamed.txt
Or move it to another folder:
mv hello.txt MyProjects/
rm — Deletes a file. Be careful with this one — there's no trash bin.
rm hello.txt
To delete an entire folder and everything inside it:
rm -rf MyProjects
⚠️ That -rf flag is serious. Double-check what you're deleting before you run it.
cat — Shows the contents of a file right in the terminal.
cat hello.txt
clear — Clears your terminal screen. Useful when things get cluttered.
clear
exit — Closes the Termux session.
exit
Package Management Commands — Installing Stuff
This is where Termux gets really useful. You can install almost any Linux tool with a single command.
pkg install — Installs a new package.
pkg install python
pkg install git
pkg install nodejs
pkg uninstall — Removes a package you don't need anymore.
pkg uninstall nodejs
pkg list-installed — Shows everything you currently have installed.
pkg list-installed
pkg search — Search for a package by name.
pkg search ffmpeg
pkg show — Shows detailed info about a package before installing it.
pkg show python
You can also use apt instead of pkg — they both work in Termux:
apt install python
apt remove python
Text Editing in Termux
You'll often need to create or edit text files — config files, scripts, notes. Termux has two main text editors built in.
Nano (Beginner Friendly)
Nano is simple. Open or create a file like this:
nano myfile.txt
Just start typing. When you're done:
Ctrl + O→ Save the fileEnter→ Confirm the filenameCtrl + X→ Exit nano
Vim (More Powerful, Steeper Learning Curve)
First install it:
pkg install vim
Open a file:
vim myfile.txt
Vim has modes. When you open it, you're in "normal" mode. To start typing, press i (insert mode). To save and quit, press Esc, then type :wq and hit Enter. To quit without saving, type :q!.
Honestly? Start with nano. Learn vim later when you're comfortable.
Networking Commands in Termux
These commands let you check your connection, ping servers, and work with networks.
ping — Tests if a server is reachable.
ping google.com
Press Ctrl + C to stop it.
curl — Fetches data from a URL. Super useful for APIs, downloading files, testing websites.
curl https://example.com
Download a file:
curl -O https://example.com/file.zip
wget — Another download tool. Simple and reliable.
pkg install wget
wget https://example.com/file.zip
ifconfig — Shows your network interface info (IP address, etc.).
pkg install net-tools
ifconfig
nmap — Network scanner. Used for finding open ports and devices on a network (for ethical purposes).
pkg install nmap
nmap 192.168.1.1
ssh — Connect to a remote server securely.
ssh username@192.168.1.100
netstat — Shows active network connections.
netstat
System and Process Commands
These commands help you understand what's happening inside your Termux environment.
uname -a — Shows your system info (kernel version, architecture, etc.).
uname -a
uptime — How long Termux has been running.
uptime
free — Shows how much memory your phone has available.
free
For a more readable format:
free -h
du — Checks how much disk space files and folders are using.
du -sh *
ps — Lists all running processes with their IDs.
ps
kill — Kills a process using its ID.
kill 1234
(Replace 1234 with the actual process ID you got from ps)
top — Real-time view of what's using your CPU and memory. Like Task Manager but in the terminal.
top
Press q to exit.
termux-info — Shows detailed info about your Termux installation, Android version, and device.
termux-info
Running Code in Termux
One of the best things about Termux is that you can run actual programming languages on your phone.
Python
pkg install python
python --version
Run a Python script:
python myscript.py
Open the Python interpreter (great for quick tests):
python
Type exit() to leave it.
Node.js (JavaScript)
pkg install nodejs
node --version
node myapp.js
PHP
pkg install php
php --version
php myfile.php
Ruby
pkg install ruby
ruby myscript.rb
Bash Scripts
Create a script:
nano myscript.sh
Add this at the top of your file:
#!/bin/bash
echo "Hello from Termux!"
Make it executable and run it:
chmod +x myscript.sh
./myscript.sh
Git Commands in Termux
Developers, this section is for you. Termux + Git is a killer combination for coding on the go.
pkg install git
Clone a repository:
git clone https://github.com/username/repo.git
Check status:
git status
Add files to staging:
git add .
Commit your changes:
git commit -m "Your commit message here"
Push to GitHub:
git push origin main
Pull latest changes:
git pull
Check log of commits:
git log --oneline
File Compression Commands
Compress and extract files without leaving the terminal.
Create a tar.gz archive:
tar -czvf mybackup.tar.gz myfolder/
Extract a tar.gz file:
tar -xzvf mybackup.tar.gz
Zip a file:
pkg install zip
zip -r archive.zip myfolder/
Unzip a file:
pkg install unzip
unzip archive.zip
Some Useful Termux Tricks You Should Know
These aren't exactly commands, but they're things that will save you a ton of time.
Tab autocomplete — Start typing a command or filename and press Tab. Termux will complete it for you. Press Tab twice to see all options if there are multiple matches.
History — Press the Up arrow key to scroll through your previous commands. You can also type:
history
To see a numbered list of everything you've run.
Ctrl + C — Stops whatever command is currently running. If something is hanging or you want to cancel, this is your escape key.
Ctrl + L — Clears the screen (same as the clear command but faster).
Running multiple sessions — Swipe from the left edge of the screen in Termux to open the sidebar. From there you can open a new session and run multiple things at the same time.
Aliases — Tired of typing long commands? Create shortcuts. Open your bash config file:
nano ~/.bashrc
Add something like:
alias update="pkg update && pkg upgrade"
Now you just type update instead of the full command. Reload the config:
source ~/.bashrc
Fun Termux Commands (Because Not Everything Has to Be Serious)
Termux doesn't have to be all business. Here are a few fun things you can do:
cowsay — Makes a cow say something in the terminal.
pkg install cowsay
cowsay "I love Termux!"
figlet — Prints text as large ASCII art letters.
pkg install figlet
figlet "TERMUX"
cmatrix — That Matrix-style falling green code effect.
pkg install cmatrix
cmatrix
Press Ctrl + C to escape the Matrix.
fortune — Prints a random quote or funny saying.
pkg install fortune
fortune
nudoku — Play Sudoku in the terminal.
pkg install nudoku
nudoku
Termux Commands Quick Reference Table
Bookmark this section. It's a quick cheat sheet you can come back to anytime.
| Command | What It Does |
|---|---|
pkg update && pkg upgrade | Update everything |
pkg install [name] | Install a package |
pkg uninstall [name] | Remove a package |
pkg list-installed | See installed packages |
ls | List files |
ls -la | List files with details |
cd [folder] | Change directory |
pwd | Show current path |
mkdir [name] | Create folder |
touch [name] | Create empty file |
rm [file] | Delete file |
rm -rf [folder] | Delete folder (careful!) |
cp [src] [dest] | Copy file |
mv [old] [new] | Move/rename file |
cat [file] | View file contents |
nano [file] | Edit file (beginner) |
vim [file] | Edit file (advanced) |
ping google.com | Test internet |
curl [url] | Fetch URL content |
wget [url] | Download file |
ssh user@ip | Connect to server |
ps | List processes |
kill [pid] | Kill a process |
top | Live process monitor |
free -h | Check memory |
uname -a | System info |
history | Previous commands |
clear | Clear screen |
exit | Close Termux session |
termux-setup-storage | Allow storage access |
termux-info | Device + Termux info |
python myscript.py | Run Python script |
git clone [url] | Clone a repo |
tar -xzvf file.tar.gz | Extract archive |
chmod +x script.sh | Make script executable |
Common Errors and How to Fix Them
If you're running into issues, here are the most common ones and exactly how to fix them.
"command not found" — The tool isn't installed yet. Just run pkg install [toolname] and try again.
"Permission denied" — You either don't have permission to access that file/folder, or you forgot to run termux-setup-storage for phone storage access.
"Unable to locate package" — Run pkg update first to refresh the package list, then try installing again.
"No space left on device" — Termux is using too much storage. Run pkg autoclean to remove cached files. Or delete stuff you don't need with rm.
Termux is running slow — Close other apps on your phone. Also run pkg upgrade — outdated packages can cause slowdowns.
What Should You Learn After This?
Now that you have the basics down, here's a path forward depending on what you're interested in:
Interested in coding? → Learn Python in Termux. Install it, write small scripts, and slowly build bigger projects. Termux makes it easy to practice anywhere.
Interested in networking? → Dig deeper into nmap, netcat, and ssh. Set up a local server on your phone using pkg install openssh.
Interested in automation? → Learn bash scripting. You can automate backups, file organization, downloads — all from your phone.
Interested in web development? → Install Python + Flask or Node.js and run a local web server directly from Termux.
Final Thoughts
Termux is one of those tools that gets more powerful the more you learn. Right now you might just be running basic commands — and that's totally fine. But in a few weeks of practicing, you'll be writing scripts, working with APIs, and doing things with your phone that most people don't even know are possible.
The commands in this guide cover probably 90% of what most Termux users do on a daily basis. Save this page, come back to it when you're stuck, and don't be afraid to experiment. The worst thing that can happen is you have to reinstall Termux — which takes about two minutes.
Now close this tab and go open Termux. You know what to type.
Frequently Asked Questions
Is Termux safe to use?
Yes. Termux itself is completely safe. It's open source and widely used. Just be careful what you install from unknown sources inside it — same rules as any software.
Do I need root to use Termux?
No. Termux works perfectly without root access. Some advanced tools may require root, but for 99% of what most people want to do, you don't need it at all.
Where should I download Termux from?
Always download from F-Droid (f-droid.org). The Google Play version is outdated and no longer maintained.
Can I use Termux to hack?
Termux is a tool, and like any tool, it depends on how you use it. Ethical hacking and security research are legitimate uses. Using it to attack systems you don't own is illegal. Always practice on your own devices or in authorized environments.
Why does Termux say "Repository is under maintenance"?
This happens sometimes with the default mirrors. Run termux-change-repo and select a different mirror. It usually fixes the issue instantly.
Comments
Post a Comment