Catalog / Termux Environment Cheatsheet
Termux Environment Cheatsheet
A comprehensive cheat sheet for navigating and utilizing the Termux terminal environment on Android. This guide covers essential commands, package management, file manipulation, and customization options to enhance your mobile development and system administration tasks.
Basic Commands & Navigation
Essential Commands
|
Print working directory - shows the current directory. |
|
List directory contents - displays files and directories in the current location. |
|
Change directory - navigates to the specified directory. |
|
Make directory - creates a new directory with the given name. |
|
Remove file - deletes the specified file. |
|
Remove directory - deletes the specified directory (must be empty). |
|
Move or rename - moves or renames a file or directory. |
|
Copy - copies a file or directory to the specified destination. |
File Manipulation
|
Concatenate and print - displays the contents of a file. |
|
Text editor - opens the nano text editor to create or modify a file. |
|
Display first lines - shows the first few lines of a file. |
|
Display last lines - shows the last few lines of a file. |
|
Search - searches for a specific pattern within a file. |
|
Change permissions - modifies the read, write, and execute permissions of a file. |
Package Management (pkg)
|
Update package lists - synchronizes the package index files from their sources. |
|
Upgrade installed packages - installs the newest versions of all packages currently installed on the system. |
|
Install a package - installs the specified package and its dependencies. |
|
Uninstall a package - removes the specified package from the system. |
|
Search for a package - searches for packages based on a keyword. |
|
Show package information - displays detailed information about a specific package. |
Advanced Termux Usage
SSH and Remote Access
|
Install OpenSSH - installs the OpenSSH server, allowing remote access to Termux. |
|
Start SSH server - starts the SSH daemon. |
|
Connect to SSH server - connects to a remote SSH server using the specified username, IP address, and port. |
|
Show current user - displays the current username. |
|
Configure network interfaces - shows network interface configuration (requires |
|
Change password - changes the password for the current user. |
Background Processes and Task Management
|
Run in background - runs a command in the background. |
|
List background jobs - displays a list of background processes. |
|
Bring job to foreground - brings a background process to the foreground. |
|
Send job to background - sends a stopped job to the background. |
|
Kill process - terminates a process with the specified process ID (PID). |
|
Display processes - shows a dynamic real-time view of running processes. |
Termux Utilities
|
Setup storage - grants Termux access to external storage. |
|
Change repository - allows changing the Termux package repository. |
|
Show battery status - displays battery information. |
|
Show wifi info - displays information about the current WiFi connection. |
|
Send notification - sends a notification to the Android system. |
|
Get clipboard content - retrieves the content from the clipboard. |
|
Set clipboard content - sets the content to the clipboard. |
Configuration and Customization
Termux Configuration Files
|
Termux properties - configuration file for Termux settings. |
|
Bash configuration - bash startup file, used to customize the shell environment. |
|
Zsh configuration - zsh startup file, used to customize the shell environment. |
|
Termux prefix - the installation directory for packages ( |
|
Change repository - change Termux package repository. |
|
Install Termux tools - installs a collection of Termux-specific tools. |
Customizing the Shell
`export PS1=”…`` |
Customize prompt - modifies the shell prompt. Example: |
|
Create alias - creates a shortcut for a command. Example: |
|
Install Zsh - installs the Zsh shell for advanced customization. |
|
Change shell - changes the default shell to Zsh. |
|
Install oh-my-zsh - framework for managing zsh configuration. |
|
Install fish - installs the fish-shell. |
Termux Styling
|
Install termux-style - install program for changing the terminal colors and font. |
|
Launch termux-style - interactive program to customize the terminal appearance. |
|
Colors config file - advanced way to customize the terminal colors. |
|
Custom fonts - path for custom font file in ttf format. |
Troubleshooting and Tips
Common Issues
Problem: |
Problem: Unable to access external storage. |
Problem: SSH connection refused. |
Problem: Command not found. |
Useful Tips and Tricks
Use tab completion to speed up command typing. Press |
Customize your Termux environment by modifying |
Install a text-based web browser like |
Utilize |
Leverage Termux’s API to interact with Android features using commands like |