Termux Command Cheat Sheet

4.2/5 - (5 votes)

Did you know your Android phone can become a mini computer? With Termux, you can use powerful Linux tools right from your phone! But if you’re new, it can look confusing. So don’t worry — I made this Termux Command Cheat Sheet just for you.

In this article, I will give you a full list of Termux commands from beginner to advanced. I’ll explain everything in a super simple way, so even a complete beginner can understand and start using Termux like a pro.

Termux cheat sheet
Termux cheat sheet

Let’s start learning, Termux commands cheat sheet:

What is Termux?

Termux is a free Android app that gives you a terminal, just like a computer. You can type commands and do things like install tools, run scripts, write code, or even learn ethical hacking.

You don’t need root to use Termux. Just download the app, and you’re ready to go.

How to Install Termux

  1. Go to F-Droid and download the latest Termux APK.
  2. Install the app on your phone.
  3. Open Termux and type this command:
apt update && apt upgrade -y

This will update Termux and make it ready to use.

Why You Need This Cheat Sheet

When you open Termux, it shows a black screen and waits for your commands. That’s why it’s important to learn the commands. This cheat sheet will help you remember all the important Termux commands.

Termux Command Cheat Sheet

Let’s break the commands into sections for easier learning.

Basic Termux Commands cheat sheet for beginners

These are the first commands you should learn.

  1. pwd : Shows the folder you are in.
  2. ls : Lists files and folders.
  3. cd foldername : Enter a folder.
  4. cd .. : Go back one folder.
  5. clear : Clears the screen.
  6. exit : Closes Termux.
  7. mkdir myfolder : Make a new folder.
  8. touch file.txt : Make a new file.
  9. cat file.txt : Show what’s inside a file.
  10. rm file.txt : Delete a file.
  11. rm -rf folder : Delete a folder and everything inside.
  12. whoami : Shows your username.
  13. date : Shows date and time.
  14. echo Hello : Print a message.

Package Management Commands

Use these commands to install, remove, or update tools in Termux.

  1. pkg update : Updates all packages.
  2. pkg upgrade : Upgrades installed tools.
  3. pkg install toolname : Install a new tool (e.g., pkg install python).
  4. pkg uninstall toolname : Remove a tool.
  5. apt update : Similar to pkg update.
  6. apt upgrade : Similar to pkg upgrade.
  7. apt install toolname : Install tools with apt.
  8. pkg list-all : List all available tools.

File and Folder Commands

These commands help you move, copy, and manage your files.

  1. mv file1 file2 : Rename or move a file.
  2. cp file1 file2 : Copy a file.
  3. cp -r folder1 folder2 : Copy a folder.
  4. ls -a : List hidden files too.
  5. ls -l : Shows file details.
  6. stat file.txt : Show file info.
READ ALSO  Best Instagram Post Downloader Tool of 2024: Download Posts in Seconds

Storage Access Commands

To access your phone files from Termux, use these:

  1. termux-setup-storage : Gives Termux access to storage.
  2. cd /sdcard : Go to your phone’s storage.
  3. ls /sdcard : See all phone files.
  4. cp file /sdcard/ : Copy a file to your storage.

Internet and Network Commands

These commands help you use internet-related tools.

  1. ping google.com : Check internet.
  2. wget link : Download something from a link.
  3. curl link : Also downloads content.
  4. ip a : Show IP address.
  5. nmap website.com : Scan open ports (after installing nmap).

Programming in Termux

You can write and run code in Termux easily.

  1. python filename.py : Run Python file.
  2. bash script.sh : Run shell script.
  3. node file.js : Run JavaScript file.
  4. nano file.txt : Open file editor.
  5. chmod +x file.sh : Make script file executable.

Git and GitHub Commands

Use GitHub tools right in Termux.

  1. pkg install git : Install git tool.
  2. git clone url : Download any tool from GitHub.
  3. cd folder : Go to the downloaded tool.
  4. bash file.sh : Run a script inside the folder.
  5. ls : See what’s inside.

Ethical Hacking Tools in Termux

Only use these for legal learning and testing!

  1. pkg install nmap : Network scanner.
  2. pkg install openssh : For SSH and SQL.
  3. pkg install whois : See domain info.
  4. source <(curl -fsSL https://kutt.it/msf) : Install Metasploit.
  5. pkg install tor : Anonymous browsing.
  6. tor : Start TOR service.
  7. nmap -sV website.com : Deep port scan.

Cool Termux Commands

These are fun commands to try in Termux.

  1. cmatrix : Shows falling green hacker text.
  2. figlet Hello : Big ASCII text.
  3. toilet Hello : Fancy colorful text.
  4. neofetch : Shows system info in a stylish way.
  5. sl : Shows a train running in terminal.
  6. fortune : Gives funny quotes.
  7. cowsay Hello : Cow says your message.
  8. asciiquarium : Shows fish aquarium in terminal.
  9. lolcat : Adds rainbow colors to text.

Useful Termux Shortcuts

These will help you use Termux faster.

  • CTRL + C : Stop running command.
  • CTRL + D : Exit terminal.
  • CTRL + L : Clear screen.
  • TAB : Auto complete.
  • UP Arrow : Shows previous commands.
  • && : Run multiple commands.
  • history : Show past commands.

Example:

apt update && apt upgrade

Programming & Python Commands in Termux

If you love coding or want to learn programming, Termux can help you do that easily. You can write and run code in different languages like Python, Bash, or JavaScript (Node.js) right from your Android phone — just like you do on a computer.

Let me show you some easy commands to use for programming in Termux.

Python Commands

To run Python programs, you first need to install Python in Termux.

Step 1: Install Python

pkg install python -y

This command installs the latest version of Python in Termux.

READ ALSO  Tool X in Termux: Easy Installation and Usage 2024

Step 2: Check Python Version

python --version

This shows which version of Python is installed.

Step 3: Create a Python Program

Create python or any other file by using command like this:

nano termux-python.py

Step 4: Write python program in Termux

This is a simple python code that you can copy and paste in Termux to test python programming:

# Simple Python Script

import datetime

print(" Hello! Welcome to the Python fun script.")

# Ask for user's name
name = input("What is your name? ")
print(f"Hi {name}, nice to meet you!")

# Do a simple addition
print("Let's add two numbers.")
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
total = num1 + num2
print(f"The total of {num1} + {num2} is {total}")

# Check if a number is even or odd
print("Now let's check if a number is even or odd.")
num = int(input("Enter a number: "))
if num % 2 == 0:
    print(f"{num} is an even number.")
else:
    print(f"{num} is an odd number.")

# Show date and time
now = datetime.datetime.now()
print("The current date and time is:", now.strftime("%Y-%m-%d %H:%M:%S"))

# Say goodbye
print(f"Thank you for using this script, {name}! Have a great day! ")

Step 5: Run python program in Termux

python termux-python.py

This command runs a Python file in Termux.

Bash Script Commands

You can also write shell scripts (small programs) and run them in Termux.

1. Make a Bash Script File

nano myscript.sh

This opens a file where you can write your bash code.

Example inside file:

#!/bin/bash

echo " Hello! Welcome to this fun bash script."
sleep 1

echo "What's your name?"
read name

echo "Hi $name! Nice to meet you!"
sleep 1

echo " Today's date is: $(date)"
sleep 1

echo " Now enter a number:"
read number

if [ $((number % 2)) -eq 0 ]; then
  echo " $number is an Even number."
else
  echo " $number is an Odd number."
fi

sleep 1
echo " Thanks for using this script, $name! Have a great day!"

2. Give Permission to Run

chmod +x myscript.sh

3. Run the Script

./myscript.sh

More Programming Tools You Can Install in Termux

ToolInstall CommandWhat It Does
Pythonpkg install pythonRuns Python scripts
Node.jspkg install nodejsRuns JavaScript files
Rubypkg install rubyRuns Ruby programs
Nanopkg install nanoOpens file editor to write code
Gitpkg install gitDownloads tools from GitHub

Download Termux Commands Cheat Sheet PDF

I have also made a PDF file that includes all the Termux commands from this cheat sheet. You can download it for free and save it on your phone. It’s great if you want to use it offline and don’t want to forget the commands.

Download Termux Command Cheat Sheet PDF

23 KB

Final Words

This article gives you a full Termux command cheat sheet from basic to advanced. These commands will help you manage files, install tools, run programs, and even try ethical hacking — all from your Android phone!

Whether you’re a beginner or someone who wants to learn cool stuff with Termux, this cheat sheet will help you start easily.


proud owner of termuxcommands.com, Assam native. Tech enthusiast, sharing Termux and Linux expertise. Simplifying tech for all—from beginners to pros. Join me on this knowledge-sharing adventure!

Leave a Comment