Termux

A comprehensive Termux cheatsheet covering

1. BASIC COMMANDS

clear # Clear terminal exit # Exit termux history # Show command history date # Show date cal # Show calendar uname -a # System info whoami # Current user id # User ID info pwd # Present working directory

2. FILE & DIRECTORY COMMANDS

ls # List files ls -la # List hidden files cd foldername # Change directory cd .. # Go back cd ~ # Home directory mkdir folder # Create folder rmdir folder # Remove empty folder rm file # Delete file rm -rf folder # Delete folder forcefully cp file1 file2 # Copy file mv file1 file2 # Move/rename file touch file.txt # Create file cat file.txt # View file nano file.txt # Edit file

3. PACKAGE MANAGEMENT

Update & Upgrade

pkg update pkg upgrade apt update apt upgrade

Install Packages

pkg install git pkg install python pkg install curl pkg uninstall package pkg search name pkg list-installed

4. STORAGE ACCESS (IMPORTANT)

termux-setup-storage cd /sdcard cd storage/shared cd storage/downloads

5. NETWORK COMMANDS

ifconfig ip a ping google.com curl http://example.com wget http://example.com/file netstat -tulnp

Install networking tools:

pkg install net-tools pkg install curl pkg install wget

6. PROCESS MANAGEMENT

ps ps aux top htop kill PID kill -9 PID jobs bg fg

7. SEARCHING COMMANDS

find . -name filename grep "text" file.txt grep -r "text" . which python whereis python

8. COMPRESSION

zip file.zip file.txt unzip file.zip tar -cvf file.tar folder tar -xvf file.tar tar -czvf file.tar.gz folder tar -xzvf file.tar.gz

9. PERMISSIONS

chmod +x script.sh chmod 777 file chown user file

10. SSH & REMOTE ACCESS

Install:

pkg install openssh

Commands:

ssh user@ip scp file user@ip:/path ssh-keygen

Start SSH server:

sshd

11. GIT COMMANDS

pkg install git git clone url git status git add . git commit -m "message" git push git pull

12. PYTHON IN TERMUX

pkg install python python python3 script.py pip install package pip list

Virtual Environment:

python -m venv myenv source myenv/bin/activate

13. BASH SHORTCUTS

Ctrl + C # Stop process Ctrl + Z # Suspend Ctrl + D # Exit Tab # Auto complete ↑ ↓ # Command history

14. USER MANAGEMENT

adduser username passwd su username

15. SYSTEM MONITORING

df -h du -sh * free -h uptime

16. TERMUX API (Extra Features)

Install:

pkg install termux-api

Examples:

termux-battery-status termux-camera-photo termux-location termux-toast "Hello"

17. BASIC PENTESTING TOOLS INSTALL

pkg install nmap pkg install hydra pkg install sqlmap pkg install john pkg install metasploit

18. ALIAS & CUSTOMIZATION

Create alias:

nano ~/.bashrc

Add:

alias update='pkg update && pkg upgrade' alias cls='clear'

Apply:

source ~/.bashrc

19. ENVIRONMENT VARIABLES

echo $PATH export NAME=value

20. CRON JOB (SCHEDULER)

pkg install cronie crontab -e

Example:

* * * * * python script.py

BONUS – USEFUL PACKAGES

pkg install neovim pkg install tmux pkg install zsh pkg install fish pkg install nodejs pkg install clang pkg install cmake

IMPORTANT DIRECTORIES

~ # Home /usr/bin # Executables /etc # Config files /storage/shared # Android storage

FULL SETUP COMMAND (For Fresh Termux)

pkg update && pkg upgrade -y pkg install git curl wget nano python clang openssh net-tools -y termux-setup-storage