Basic Usage

Now that you have Termux OS installed, lets explore some basic usage and essential commands to help you get started.

  1. Print Working Directory:
    pwd
    

2. **List Files and Directories**:

```shellscript
ls
ls -l  # Detailed list
ls -a  # Show hidden files
  1. Change Directory:
cd /sdcard  # Go to your device's storage
cd ~        # Go to your home directory
cd ..       # Go up one directory
  1. Create a Directory:
mkdir my_project
  1. Remove a Directory:
rmdir empty_directory
rm -r non_empty_directory  # Be careful with this!

File Operations

  1. Create a File:
touch newfile.txt
  1. Edit a File:
nano myfile.txt
  1. View File Contents:
cat myfile.txt
less longfile.txt  # For longer files
  1. Copy a File:
cp source.txt destination.txt
  1. Move or Rename a File:
mv oldname.txt newname.txt
  1. Delete a File:
rm unwanted_file.txt

Package Management

  1. Update Package Lists:
pkg update
  1. Upgrade Installed Packages:
pkg upgrade
  1. Install a Package:
pkg install package_name
  1. Remove a Package:
pkg uninstall package_name
  1. Search for a Package:
pkg search keyword

Process Management

  1. View Running Processes:
ps
  1. Kill a Process:
kill process_id
  1. Run a Process in the Background:
command &

Network Operations

  1. Check Network Connectivity:
ping google.com
  1. Download a File:
wget https://example.com/file.zip
  1. Check IP Address:
ifconfig

Text Processing

  1. Search for Text in Files:
grep "search_term" file.txt
  1. Count Lines, Words, and Characters:
wc file.txt

Permissions

  1. Change File Permissions:
chmod 644 file.txt
  1. Change File Ownership:
chown user:group file.txt

Useful Termux-specific Commands

  1. Access Device Clipboard:
termux-clipboard-get
echo "text" | termux-clipboard-set
  1. Get Device Battery Status:
termux-battery-status
  1. Take a Photo:
termux-camera-photo image.jpg
  1. Get Device Location:
termux-location

Tips for Efficient Usage

  1. Use the Tab key for auto-completion of commands and file names.
  2. Use the up and down arrow keys to navigate command history.
  3. Use Ctrl+C to interrupt a running command.
  4. Use Ctrl+Z to suspend a process and fg to bring it back to the foreground.

Next Steps

Now that you're familiar with basic Termux OS usage, you're ready to explore more advanced features. In the next section, we'll dive into advanced features and customizations to help you get the most out of your Termux OS environment.