█
LastWrite
  • > Curriculum
  • > Pricing
  • > For Educators
  • > About
  • > Contact
Log InGet Started

Questions, concerns, bug reports, or suggestions? We read every message, write to us at [email protected].

More ways to reach us →
LastWrite

Structured computer science lessons for aspiring developers and security professionals.

[email protected]

(201) 785-7951

Mon–Fri, 9 AM–5 PM EST

Learn

  • Curriculum
  • Pricing

Company

  • About
  • For Educators & Schools
  • Contact Us

Legal

  • Terms of Service
  • Privacy Policy
© 2026 LastWrite. All rights reserved.
Curriculum/Web Development/Introduction to the Terminal and Linux
35 minBeginner

Introduction to the Terminal and Linux

After this lesson, you will be able to: Navigate the file system, manage files, and run scripts from the terminal using the most common Unix commands.

Almost every developer tool, git, npm, Python, deployment commands, is run from the terminal. This lesson covers the handful of commands you'll actually use every day, and how to use the in-browser editor.

Prerequisites:Python Functions and Automation

What is the terminal, really?

The terminal is a text-based way to talk to your computer. Instead of clicking icons, you type commands. On Mac and Linux it's called Terminal; on Windows it's PowerShell or the WSL shell. The commands in this lesson are the Unix-style ones used everywhere except plain Windows cmd.

File Explorer (GUI)
  • ·Click folder icons to open them
  • ·Double-click to run a file
  • ·Drag and drop to move things
Terminal (CLI)
  • ·Type commands at a text prompt
  • ·`ls` lists what is in a folder
  • ·`cd` moves you into a folder
Same file system, two ways to drive it. The terminal is faster once the commands are muscle memory.

Navigation commands

These are the four you will use constantly.

tsx
pwd # print working directory (where am I?)
ls # list files in current directory
ls -la # list everything, with details
cd projects # change directory into projects
cd .. # go up one level
cd ~ # go to your home directory

Creating and managing files

These commands create, copy, move, and remove files.

tsx
mkdir my-site # make a directory
touch index.html # create empty file
cp index.html backup.html # copy
mv backup.html old.html # move (or rename)
rm old.html # delete file
rm -r my-site # delete folder + contents

⚠️ Warning, rm has no undo

Unlike the GUI trash, files removed with rm are gone. Always double-check the path before pressing Enter, especially with rm -rf.

Try it: make a project folder from the shell

Use the Shell tab in your editor (or your local terminal) to run these in order.

  1. 1

    Type pwd and read the output

  2. 2

    Run mkdir lastwrite-practice and then cd lastwrite-practice

  3. 3

    Create three files: touch hello.py notes.txt readme.md

  4. 4

    Run ls -la to confirm they exist

  5. 5

    Write a quick Python file with echo "print('hi')" > hello.py and run it with python hello.py

Bonus: chaining and piping

The | (pipe) feeds the output of one command into another. The > redirects output to a file.

tsx
ls -la > files.txt # write directory listing to a file
cat files.txt | wc -l # count the lines
Quick Check

Which command shows you the path of the directory you're currently in?

Pick the one that prints your location.

Sign in and purchase access to unlock this lesson.

Sign in to purchase
←Python Functions and Automation
Back to Web Development
How the Web Works→