Getting Started with Useful Termux Commands
Termux is a powerful terminal emulator and Linux environment app for Android. It allows you to access the Linux command line on your Android device and run various Linux applications and commands. If you're new to Termux, learning some basic commands can help you get up and running quickly.
Accessing Termux
Termux is available for free on the Google Play Store. Once installed, open the Termux app to access the terminal interface. The first time you open it, Termux will install some starter packages and set up the file system - just give it a minute or two.
Help Commands
If at any time you need a reminder for commands or syntax, Termux has built-in help.
help
- List available commands with short descriptions[command] --help
- Get help info for a specific command. Replace[command]
with the name of the command you want help with.
Basic Linux Commands
Many standard Linux shell and bash commands work in Termux to help you navigate the file system and manage files and directories. Here are some basics to know:
ls
- List files and folders in current directorycd [directory]
- Navigate into a directorymkdir [name]
- Make a new directorypwd
- Show current working directory (print working directory)cp [source] [dest]
- Copy files and foldersmv [source] [dest]
- Move or rename files and foldersrm [name]
- Remove files (use-r
flag to remove non-empty directories)
Apt Package Manager
The apt package manager allows you to search for and install new applications and packages into your Termux environment:
apt update
- Update list of available packagesapt upgrade
- Upgrade installed packages to the newest available versionsapt install [package]
- Install a packageapt remove [package]
- Uninstall / remove an installed package
This allows you to expand the functionality of Termux by downloading packages like Git, languages like Python, editors like Vim or Emacs, and more.
Termux-Setup-Storage
Some apps require storage permissions to save files. Use termux-setup-storage
to allow storage access for Termux. You'll have to confirm the permission prompt for file storage access.
Customizing the Shell Experience
You can customize and enhance your Termux terminal experience by modifying the shell and config:
echo $SHELL
- See current shellchsh
- Change default shell: Consider zsh or fish for more featuresInstall oh-my-zsh:
sh -c "$(curl -fsSL
https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh
)"
Create and modify
~/.termux/
termux.properties
to set options like colors
Take some time to explore these basic Termux commands to get familiar with the Linux environment capabilities. There is a lot more you can do by installing additional packages and tools using the apt package manager.
Subscribe to my newsletter
Read articles from Pratik M directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Pratik M
Pratik M
As an experienced Linux user and no-code app developer, I enjoy using the latest tools to create efficient and innovative small apps. Although coding is my hobby, I still love using AI tools and no-code platforms.