📱

Beginner's Guide to Termux Basics

Sep 26, 2024

Termux Tutorial for Beginners

Introduction

  • Full tutorial about Termux.
  • Topics covered:
    • Interface
    • Basic commands
    • Zipping and unzipping files

What is Termux?

  • An Android terminal emulator that creates a Linux environment on your device.
  • Allows installation of various packages, similar to those on Kali Linux.
  • Can run on both rooted and unrooted devices.
    • Unrooted devices have some limitations.
    • The tutorial is conducted on an unrooted device.

Installing Termux

  • Available on Google Play Store and FDroid.
  • Recommended to install from FDroid due to lack of updates on Google Play.
  • Installation Steps:
    1. Search for FDroid in the browser and download it from FDroid.org.
    2. Install FDroid, then open it.
    3. Search for "Termux" in FDroid.
    4. Install the Termux application from the search results.
    5. Allow installations from FDroid if prompted.

Termux Interface Overview

  • Clicking on the screen brings up the keyboard for command input.
  • Swipe left to view session tab (up to 8 sessions can be created).
  • Hold on the screen for options like copy, paste, and more.
  • Use the escape button, ctrl, and l buttons from the keyboard.

Basic Commands

  • Setup Storage:
    • termux-setup-storage
    • Grants storage permissions.
  • Package Management:
    • apt list: Lists available packages.
    • apt update: Updates package list.
    • apt list --upgradable: Lists upgradable packages.
    • apt upgrade: Upgrades installed packages (enter Y to confirm).
  • Execute Multiple Commands:
    • command1 && command2 && command3 to run several commands sequentially.
  • Command History:
    • Use history to view command history.
  • Kill Sessions:
    • Use exit to kill the current session easily.

File and Directory Navigation

  • Current Directory:
    • pwd: Prints the current directory.
  • Change Directory:
    • cd ..: Go up one directory.
    • cd directory_name: Enter a subdirectory.
    • cd: Return to the home directory.
  • List Directory Contents:
    • ls: Lists files and directories.
  • Create and Manage Directories:
    • mkdir new_directory: Creates a new directory.
    • rmdir empty_directory: Removes an empty directory.
    • rm -r directory_name: Removes a non-empty directory.

Creating and Managing Files

  • Create Files:
    • touch filename.txt: Creates a new file.
  • View File Contents:
    • cat filename.txt: Displays contents of a file.
  • Edit Files:
    • Use nano filename to edit files with the nano text editor.
  • Delete Files:
    • rm filename: Deletes a file.

Moving and Copying Files

  • Move Files:
    • mv source destination: Moves files or directories.
  • Copy Files:
    • cp -r source destination: Copies files or directories (use -r for directories).

Zip and Unzip Files

  • Install Zip/Unzip:
    • apt install zip unzip: Install zip and unzip packages.
  • Zip a Directory:
    • zip -r zipfile.zip directory: Zips a non-empty directory.
  • Unzip a File:
    • unzip zipfile.zip: Unzips a file.

Termux API

  • Install Termux API from FDroid.
  • Commands available to access device features:
    • termux-battery-status: Get battery information.
    • termux-camera-photo: Take photos using the camera.
    • termux-telephony-call: Make calls directly from terminal.

Conclusion

  • Explore Termux and learn more as you use it.
  • Reach out for help via social media if needed.
  • Video ends with a reminder to like and subscribe.