Getting Started with Useful Termux Commands

Getting Started with Useful Termux Commands

·

3 min read

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 directory

  • cd [directory] - Navigate into a directory

  • mkdir [name] - Make a new directory

  • pwd - Show current working directory (print working directory)

  • cp [source] [dest] - Copy files and folders

  • mv [source] [dest] - Move or rename files and folders

  • rm [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 packages

  • apt upgrade - Upgrade installed packages to the newest available versions

  • apt install [package] - Install a package

  • apt 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:

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.