Personal Development

Command Line Mastery: From Terminal Zero to Hero

Command Line Mastery: From Terminal Zero to Hero

Course Duration: Self-paced (Estimated 1-2 Months) Goal: To navigate, control, and automate your computer without a mouse.

Module 1: The First Steps (Beginner)

1. Concepts & Setup

  • The Terminal vs. The Shell: Understanding that the Terminal is the window, and the Shell (Bash/Zsh) is the language running inside it.
  • The Prompt: Decoding user@hostname:~$.
  • Setup:
    • Mac/Linux: Open "Terminal".
    • Windows: Install WSL2 or Git Bash.

2. Navigation (Moving Around)

  • pwd (Print Working Directory): Where am I right now?
  • ls (List): Seeing files. Flags: ls -a (hidden files), ls -l (detailed view).
  • cd (Change Directory): Moving folders.
    • cd foldername (Go in)
    • cd .. (Go back/up one level)
    • cd ~ (Go Home)
  • The Tab Key: The most important key—auto-completing file names.

3. File Manipulation (Creating & Destroying)

  • mkdir: Make directory (create a folder).
  • touch: Create an empty file.
  • cp: Copy files and folders (cp -r for folders).
  • mv: Move files (also used to Rename files).
  • rm: Remove (delete) files.
    • Warning: rm -rf deletes folders recursively and force—use with extreme caution!

Module 2: The Power of Text (Intermediate)

4. Viewing Content

  • cat: Dump the whole file content to screen.
  • less: Scroll through large files page by page.
  • head / tail: View just the top or bottom 10 lines of a file (tail -f is vital for watching live logs).

5. Editing Files

  • Nano: The beginner-friendly editor.
    • nano filename -> Edit -> Ctrl+O (Save) -> Ctrl+X (Exit).
  • Vim: The pro editor (optional but powerful).
    • Modes: Insert vs. Command.
    • :wq (Write and Quit).

6. Search & Filter (The "Pipeline")

  • grep: Search for specific text inside files.
    • Example: grep "error" server.log
  • The Pipe |: Taking the output of one command and feeding it into another.
    • Example: cat huge_file.txt | grep "password"

Module 3: System Control (Intermediate)

7. Permissions & Users

  • sudo (SuperUser Do): Running commands as Administrator/Root.
  • File Permissions: Understanding Read (r), Write (w), Execute (x).
  • chmod: Changing permissions (e.g., chmod +x script.sh to make a file executable).
  • chown: Changing file ownership.

8. Process Management

  • top / htop: The Task Manager of the terminal (CPU/RAM usage).
  • ps: Snapshot of current processes.
  • kill: Stopping a crashed program (e.g., kill -9 PID).

Module 4: Streams & Redirection (Advanced)

9. Input/Output Redirection

  • Standard Output (>): Save command results to a file.
    • ls > my_files.txt (Overwrites).
  • Append (>>): Add results to the end of a file.
    • echo "Log entry" >> log.txt.
  • Standard Error (2>): Redirecting only error messages.

10. Environment Variables

  • Variables: Creating shortcuts (MY_NAME="Chidi").
  • $PATH: How the computer finds programs to run.
  • .bashrc / .zshrc: Configuration files to make aliases (permanent shortcuts) and customize your prompt.

Module 5: Networking & Remote Access (Advanced)

11. The Internet from CLI

  • ping: Check if a server is alive.
  • curl: Transfer data from URLs (downloading files or testing APIs).
  • wget: downloading files (simpler than curl for downloads).
  • ifconfig / ip addr: Check your IP address.

12. SSH (Secure Shell)

  • Remote Access: Logging into a remote server (ssh user@192.168.1.5).
  • SSH Keys: Generating keys (ssh-keygen) to log in without passwords (essential for servers/GitHub).

Module 6: Scripting & Automation (Pro)

13. Bash Scripting Basics

  • The Shebang: #!/bin/bash.
  • Variables & Math: Doing calculations.
  • Loops: for loops to rename 1,000 files at once.
  • Conditionals: if [ -f file.txt ]; then... (If file exists, do this).

14. Cron Jobs

  • Automation: Scheduling scripts to run automatically (e.g., "Run backup.sh every day at 3 AM").
  • crontab -e: Editing the schedule.

Practical Projects

Project 1: The Organizer

Write a script that looks at your "Downloads" folder and automatically moves images to a "Pictures" folder and documents to a "Docs" folder.

Project 2: The Server Setup

Use ssh to connect to a cloud server (AWS/DigitalOcean), install a web server using apt-get install apache2, and change the default index.html using nano.

Project 3: Log Analyzer

Download a massive log file and use grep, awk, and | (pipes) to count exactly how many 404 errors occurred on a specific date.


Essential Cheat Sheet Resources

  • tldr: A better man page (Type tldr tar for practical examples instead of reading the manual).
  • Explainshell.com: Type a complex command string, and it breaks down exactly what every flag does.

AI Powered Course

This course is powered by our advanced AI Tutor. You will have access to an interactive learning experience that adapts to your needs.

Want to see what you'll learn?
Command Line Mastery: From Terminal Zero to Hero | Ravemy | Ravemy