pwd — Shows the current directory path you are in.
ls — Lists all files and folders in the current directory.
cd foldername — Enters into a folder named foldername
.
cd .. — Goes back one folder (to parent directory).
mkdir newfolder — Creates a new folder named newfolder
.
rm file.txt — Deletes a file named file.txt
.
clear — Clears the terminal screen.
cp file1.txt file2.txt — Copies file1.txt
and names the copy file2.txt
.
mv oldname.txt newname.txt — Renames or moves a file.
nano file.py — Opens a file called file.py
for editing using the Nano editor.
nano script.sh — Opens or creates a shell script file.
touch newfile.py — Creates a new empty file called newfile.py
.
chmod +x script.sh — Makes a script executable (adds run permission).
python3 file.py — Runs a Python file using Python 3 interpreter.
bash script.sh — Executes a shell script in the terminal.
echo "print('Hello')" > hello.py — Writes a Python print statement into a file.
cat file.py — Displays the full content of file.py
.
head -n 10 file.py — Shows the first 10 lines of the file.
tail -n 10 file.py — Shows the last 10 lines of the file.
wc -l file.py — Counts the number of lines in the file.
file file.py — Tells you the file type of file.py
.
pkg install git — Installs Git version control tool (Termux).
pkg install python — Installs Python in Termux (if not installed).
pkg install curl — Installs Curl, a command-line download tool.
pkg install nodejs — Installs Node.js for JavaScript backend development.
pip install flask — Installs Flask framework (Python backend).
pip install requests — Installs the requests module for APIs and HTTP calls.
pip install beautifulsoup4 — Installs BeautifulSoup for web scraping.
npm install express — Installs Express.js for building APIs (Node.js).
npm install nodemon — Installs nodemon (auto restarts Node app on change).
apt update && apt upgrade — Updates and upgrades packages (like on Debian/Ubuntu).
pip list — Shows all installed Python packages.
npm list — Shows all installed Node.js packages locally.
git --version — Checks if Git is installed and shows version.
git init — Initializes a new Git repository in your current folder.
git clone <repo-link> — Copies a project from GitHub to your device.
git status — Shows changes in the current repo.
git add . — Stages all changes to be committed.
git commit -m "message" — Saves your changes with a message.
git remote add origin <url> — Links your project to GitHub.
git push -u origin main — Uploads your code to GitHub (first time push).
git pull — Downloads new changes from GitHub to your local project.
git log — Shows history of commits in your project.
python3 -m http.server — Launches a simple web server on localhost (default port 8000).
flask run — Runs your Flask backend (usually on localhost:5000
).
npm start — Starts your Node.js app as defined in package.json
.
firebase deploy — Deploys your Firebase project (e.g., hosting, functions).
vercel --prod — Deploys site to Vercel (if Vercel CLI is installed).
netlify deploy — Uploads your static site to Netlify using CLI.
chmod +x deploy.sh — Makes a deployment script file executable.
sh deploy.sh — Runs your deployment script.
top — Shows live system usage: CPU, memory, tasks, and processes.
htop — A colorful and interactive version of top
(if installed).
df -h — Shows available and used disk space in human-readable format.
free -h — Displays memory (RAM) usage info.
uptime — Shows how long your system has been running and system load average.
whoami — Tells you the currently logged-in user.
uname -a — Shows system information like kernel version and architecture.
termux-info — Shows system info specific to Termux (includes app version, storage).
ping google.com — Tests if your device can reach a server and shows response time.
ip a — Lists all IP addresses and network interfaces.
ifconfig — Displays IP address and network data (might need installation).
nslookup example.com — Checks DNS record (IP info) for a domain name.
traceroute example.com — Traces the path packets take to reach a server.
netstat -tuln — Shows all open ports and services running (TCP/UDP).
curl ifconfig.me — Shows your public IP address (via curl).
wget https://site.com — Downloads a file or page from the internet.
ls -l — Shows file details including permissions, owner, group, and size.
chmod +x file.sh — Adds execute permission to a file.
chmod 755 script.sh — Sets full access for owner, read/execute for group/others.
chmod 644 file.txt — Read/write for owner, read-only for others.
chown username file.txt — Changes the ownership of the file to a specific user.
chgrp groupname file.txt — Changes the group owner of a file.
umask — Shows the default permission mask for new files and folders.
zip archive.zip file1.txt file2.txt — Compresses files into a .zip archive.
unzip archive.zip — Extracts a .zip archive.
tar -cvf archive.tar file1 file2 — Creates a .tar file (not compressed).
tar -xvf archive.tar — Extracts a .tar archive.
tar -czvf archive.tar.gz foldername — Creates a compressed .tar.gz archive.
tar -xzvf archive.tar.gz — Extracts a compressed .tar.gz archive.
gzip file.txt — Compresses a file using gzip (adds .gz extension).
gunzip file.txt.gz — Decompresses a gzip file.
You’ve just walked through the **command-line mastery plan** — from basic commands to deployment, version control, system monitoring, networking, file permissions, and even compression tools.
Every great developer starts from the **terminal**. Learn one command per day. Repeat. Break things. Fix them. Learn again. Build your own path.
“Master the shell, and you master your world.”
magick
)
🖼️ Objective: Convert, resize, and compress images using CLI.
This tool gives you magick
command for image processing.
This ensures you can convert between formats like JPEG, PNG, WebP, etc.
Syntax: magick input.jpg output.png
This command resizes the width to 500px while keeping aspect ratio.
This resizes to fixed width and height. May distort aspect ratio.
Adjust quality (e.g., 60) to reduce size without much loss in visible quality.
Strips hidden data like device info, GPS, etc., from the image file.
Useful for websites. WebP is lightweight and web-optimized.
This command loops through all JPGs and saves as PNGs.
ffmpeg
)
🎧 Objective: Convert, trim, compress, and extract audio using CLI.
Use this in Termux to get the ffmpeg package.
Change audio format using a simple command.
This trims first 30 seconds only.
This reduces file size by lowering bitrate.
Use this to get the audio (MP3) from a video.
This joins two MP3 files into one audio track.
ffmpeg
)
🎬 Objective: Convert, trim, resize, compress, and manipulate videos using CLI.
Change format from MP4 to AVI.
Extracts only first 10 seconds from a video.
Scales down video resolution to 1280x720.
Adjust bitrate to compress video and save space.
Takes a screenshot at 1-second mark (or change time).
Removes audio completely from a video.
🎤 Objective: Convert text to natural-sounding voice, and optionally clone a voice.
Start by installing Python and pip support:
Install gTTS (Google Text-to-Speech):
Run this Python code to create MP3:
Play the file (ensure mpv
or termux-media-player
is installed):
Install pyttsx3 and dependencies:
Then run the following script:
Create an account at ElevenLabs.io, get your API key, then:
Install requests
:
Sample API call (replace YOUR_API_KEY
):
You can upload your voice sample and clone from it.
Use ffmpeg to convert to another format:
📂 Goal: Export all output files (TTS, images, video, etc.) to your device's storage.
Move output.jpg
to Downloads
folder:
You can also move to DCIM folder:
Move generated voice.mp3
or output.wav
to Music folder:
Send final output.mp4
to phone’s gallery:
Or move to Movies:
To see available folders in Termux:
Use this to navigate and verify your paths.
1. Connect phone to PC via USB cable.
2. Enable “File Transfer Mode” on phone.
3. Move files to /sdcard/Download
first:
4. Then open your phone on PC and drag the file from “Download”.
Use if ADB is set up on your PC:
🔐 Objective: Encrypt sensitive files and decrypt them securely.
🌐 Objective: Use CLI to download files using curl or wget.
🎮 Objective: Play simple terminal games and ASCII-based fun apps.