Back to course

Introducing Termux Management Utility (tmo and aliases)

Termux Masterclass: From Zero to Linux Power User on Android

25. Introducing Termux Management Utility (tmo and aliases)

Termux doesn't have a single, unified 'management utility,' but we can create one using shell aliases and functions to streamline common tasks.

What is an Alias?

An alias is a short, custom command that acts as a shortcut for a longer command sequence.

Creating Your 'tmo' (Termux Management Operator) Alias

We typically store aliases in the .bashrc (for Bash) or .zshrc (for Zsh) file in your home directory. Let's start with Bash.

  1. Open .bashrc: bash $ nano ~/.bashrc

  2. Add Common Aliases: Add the following lines to the end of the file:

    bash

    Always update/upgrade with one command

    alias tmo_up='pkg update && pkg upgrade'

    Clean unused dependencies and temporary files

    alias tmo_clean='pkg autoremove && rm -rf /tmp/*'

    Quick list of files and permissions

    alias ll='ls -lhA'

    Quick navigation to Android Downloads

    alias cdls='cd ~/storage/downloads'

  3. Apply Changes: Save (Ctrl+O) and exit (Ctrl+X). For the changes to take effect in the current session, run: bash $ source ~/.bashrc

Testing Your Custom Commands

Now, instead of typing pkg update && pkg upgrade, you just type:

bash $ tmo_up

This simple customization significantly improves workflow and prepares us for deeper scripting.