jypi
  • Explore
ChatWays to LearnMind mapAbout

jypi

  • About Us
  • Our Mission
  • Team
  • Careers

Resources

  • Ways to Learn
  • Mind map
  • Blog
  • Help Center
  • Community Guidelines
  • Contributor Guide

Legal

  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Content Policy

Connect

  • Twitter
  • Discord
  • Instagram
  • Contact Us
jypi

© 2026 jypi. All rights reserved.

Introduction to Artificial Intelligence with Python
Chapters

1Orientation and Python Environment Setup

Syllabus OverviewLearning OutcomesSoftware RequirementsPython InstallationVirtual EnvironmentsIDE Setup VS CodeJupyter NotebooksConda vs PipProject StructureGit and GitHubCommand Line BasicsReproducibility BasicsDataset SourcesAsking for HelpCourse Project Brief

2Python Essentials for AI

3AI Foundations and Problem Framing

4Math for Machine Learning

5Data Handling with NumPy and Pandas

6Data Cleaning and Feature Engineering

7Supervised Learning Fundamentals

8Model Evaluation and Validation

9Unsupervised Learning Techniques

10Optimization and Regularization

11Neural Networks with PyTorch

12Deep Learning Architectures

13Computer Vision Basics

14Model Deployment and MLOps

Courses/Introduction to Artificial Intelligence with Python/Orientation and Python Environment Setup

Orientation and Python Environment Setup

872 views

Set up the Python environment, tools, and workflows you will use throughout the course.

Content

11 of 15

Command Line Basics

Press Any Key to Level Up — The No-Chill CLI Crash Course
3 views
beginner
humorous
computer science
visual
gpt-5
3 views

Versions:

Press Any Key to Level Up — The No-Chill CLI Crash Course

Watch & Learn

AI-discovered learning video

YouTube

Start learning for free

Sign up to save progress, unlock study materials, and track your learning.

  • Bookmark content and pick up later
  • AI-generated study materials
  • Flashcards, timelines, and more
  • Progress tracking and certificates

Free to join · No credit card required

Command Line Basics: Your AI Project's Secret Superpower

The terminal is not angry. It is just concise. Treat it like a very literal coworker who only speaks in verbs.


Why are we here (again)?

Remember how, in Project Structure, we gave your repo a skeleton with src/, data/, and notebooks/? And in Git and GitHub, we made your code immortal on the internet? Great. Now we meet the social club where both of them hang out: the command line.

This is where you will:

  • Run Python scripts like a boss
  • Set up and activate virtual environments (your AI project's oxygen mask)
  • Move through your project faster than any GUI clickathon
  • Automate repeatable tasks so you can save energy for, you know, AI

If Git is the memory and structure is the body, the command line is the nervous system. Time to wire it up.


Opening the terminal (aka, summoning the text dragon)

  • macOS: Open Terminal or iTerm
  • Linux: You already know. Ctrl+Alt+T or your preferred terminal
  • Windows: Use PowerShell (not the ancient cmd)
  • VS Code: View > Terminal (best option to stay inside your project)

A typical prompt looks like:

username@machine project-path $

It is waiting for a command. Like a loyal dog, but faster and with fewer zoomies.

Pro tips before we sprint:

  • Ctrl + C: cancel a stuck command
  • Up/Down arrows: command history
  • Tab: auto-completion (your new best friend)
  • clear or cls: clean the screen

Paths, but make them vibes

Your project probably looks something like:

ai-intro/
├─ src/
│  ├─ main.py
│  └─ utils/
├─ data/
│  └─ raw/
└─ notebooks/

Key path concepts you must tattoo onto your soul:

  • Absolute path: from the root of your file system, e.g., /Users/you/ai-intro
  • Relative path: from where you currently are, e.g., src/utils
  • . means current directory
  • .. means parent directory
  • ~ means your home directory
  • Spaces in paths need quotes, e.g., 'My Projects/ai-intro'

Check where you are and what is around you:

# Where am I?
pwd
# What is here?
ls
# Go into src, then back out
cd src
cd ..

On Windows PowerShell, ls, cat, rm, mv, and cp are convenient aliases that work like macOS/Linux. If you ever get stuck, you can use full cmdlets like Get-ChildItem, Remove-Item, etc.


Navigation and file wrangling

Let us move like we mean it.

  • Create things:
    • mkdir data/processed
    • macOS/Linux: touch src/utils/helpers.py
    • Windows PowerShell: New-Item -ItemType File src/utils/helpers.py
  • Copy and move:
    • cp src/main.py src/main_backup.py
    • mv src/main_backup.py src/old_main.py
  • Remove with care:
    • rm old_file.txt
    • rm -r junk_folder
    • PowerShell equivalent also supports rm -Recurse
  • Peek inside files:
    • cat src/main.py
    • less src/main.py (q to quit)
    • head -n 5 data/raw/some.csv
    • tail -n 10 logs/app.log

Wildcards are your productivity multiplier:

  • ls data/raw/*.csv lists all csv files
  • rm -r data/temp_* deletes folders that start with temp_ (double-check before you press enter)

Why do people keep misunderstanding this? Because GUIs hide the map. The CLI shows you the coordinates.


Redirection and pipes: command choreography

Combine small, focused commands like Lego blocks.

  • Redirect output to a file:
    • echo hello > notes.txt (creates or overwrites)
    • echo another line >> notes.txt (appends)
  • Pipe output from one command to another:
    • cat data/raw/big.csv | head -n 5
    • ls src | wc -l (how many files? macOS/Linux)
    • PowerShell count: ls src | Measure-Object | Select-Object -ExpandProperty Count
  • Quick grep vibes:
    • macOS/Linux: cat src/main.py | grep import
    • PowerShell: Select-String -Path src/main.py -Pattern import

The CLI is like texting your computer in its mother tongue. Short, specific, and very literal.


Python from the terminal (the main event)

You have got Python. Prove it:

# macOS/Linux
python3 --version

# Windows
py -3 --version
# or
python --version

Virtual environment time. This keeps your AI project dependencies isolated from your global computer health.

# From your project root
python -m venv .venv

# Activate it
# macOS/Linux
source .venv/bin/activate
# Windows PowerShell
.\.venv\Scripts\Activate.ps1

# Your prompt should now show (.venv)

# Upgrade pip and install deps
python -m pip install --upgrade pip
pip install -r requirements.txt  # if you have one

# Confirm
which python            # macOS/Linux
where.exe python        # Windows cmd
Get-Command python      # Windows PowerShell

Run your code:

python src/main.py

Run a module directly (handy for tools):

python -m venv --help
python -m pip list

Good housekeeping:

  • Add .venv to .gitignore (you do not need 300 MB of site-packages in your repo)
  • Deactivate when done: deactivate

Your Git powers, now turbocharged by CLI

You learned Git already; now stitch it into your daily terminal flow:

# Where am I in Git-land?
git status

# Save your progress
git add -A
git commit -m 'Finish data loader for iris dataset'

# Sync with GitHub
git pull --rebase
git push

Pro tip: Branching is just paths for commits. Same navigation mindset.


Cross-platform quick table

Task macOS/Linux Windows PowerShell
Where am I pwd pwd
List files ls ls (alias for Get-ChildItem)
Change directory cd path cd path
Make directory mkdir name mkdir name
Create file touch file.py New-Item -ItemType File file.py
Remove file rm file rm file
Remove folder rm -r folder rm -Recurse folder
Show file cat file.py cat file.py (alias for Get-Content)
Search in file grep pattern file Select-String -Pattern pattern -Path file
Clear screen clear cls or Clear-Host
Which Python which python Get-Command python or where.exe python

If you prefer Unix-like commands on Windows, install Git Bash or use Windows Subsystem for Linux (WSL). But PowerShell is fine for 99 percent of this course.


Mini-lab: 8 moves to feel dangerous (the good kind)

  1. Open the terminal in your ai-intro project root
  2. Verify your structure:
pwd
ls
  1. Make a place for intermediate data:
mkdir -p data/interim   # PowerShell: mkdir data/interim
  1. Create a new script and a log file:
# macOS/Linux
touch src/utils/io_helpers.py

# PowerShell
New-Item -ItemType File src/utils/io_helpers.py

# Everyone
echo run started > logs.txt
  1. Activate your virtual environment and install numpy:
python -m venv .venv
source .venv/bin/activate        # or .\.venv\Scripts\Activate.ps1 on Windows
python -m pip install --upgrade pip
pip install numpy
  1. Sanity-check Python paths:
python -c 'import sys,site; print(sys.executable); print(site.getsitepackages())'
  1. Run your main script:
python src/main.py
  1. Commit your changes like the responsible scientist you are:
git add -A
git commit -m 'Add io_helpers and set up venv with numpy'
git push

If anything goes sideways, use git status and retrace your steps with the up arrow. The terminal keeps receipts.


Gotchas and power tips

  • Quote paths with spaces: cd 'My Projects/ai-intro'
  • Use tab to avoid typos; it is both faster and calmer
  • rm is forever. If you are nervous, use trash-cli or confirm flags, or do a dry-run with echo
  • Use history or Get-History to re-run useful commands
  • In VS Code, you can run code . to launch the editor from the current folder

Wrap-up: what just happened?

You learned how to navigate, create, inspect, and destroy files from the CLI; how to chain commands like a pro; and how to run Python and manage a virtual environment. This plugs directly into your project structure and your Git workflow, turning all three into a smooth daily ritual.

Key takeaways:

  • The CLI is faster because it is composable
  • Relative paths make you nimble inside your project
  • Virtual environments keep dependencies civilized
  • Git and the terminal are best friends; use them together

Final thought: You do not have to memorize every command. Memorize patterns. The rest is tab-complete and muscle memory.

Now go talk to your computer. Politely. With verbs.

Flashcards
Mind Map
Speed Challenge

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!

Ready to practice?

Sign up now to study with flashcards, practice questions, and more — and track your progress on this topic.

Study with flashcards, timelines, and more
Earn certificates for completed courses
Bookmark content for later reference
Track your progress across all topics