Swipe
SwipeSwipe
Swipe Apps

Paths

Motivation

Information

The Command Line · Lesson 3 of 6

Making & Removing Things

A free lesson from Swipe Coding · Ship It, level 1 · updated October 2026

By the Swipe team, founded by Colin · how we make lessons

🤖
mkdir makes folders, touch makes empty files — the two commands you'll use to start almost every project. 📁

Beyond navigating, you'll constantly need to create and clear away files and folders. mkdir ("make directory") creates a new folder. touch creates a new, empty file (its original purpose was updating a file's timestamp, but creating an empty file with it became the everyday habit). Both take the name of what you want to create as an argument — extra text typed right after the command.

$ mkdir my-project
$ cd my-project
$ touch index.js
$ ls
index.js
Creating a new folder, moving into it, then creating an empty file inside it.

To delete things, rm ("remove") deletes a file, and rm -r ("recursive") deletes a folder along with everything inside it. This is the one command in this whole lesson to treat with real caution: unlike deleting through your file explorer, the terminal has no recycle bin or trash — rm deletes immediately and permanently.

$ rm old-notes.txt
$ rm -r old-folder
rm deletes a single file; rm -r deletes a folder and everything inside it, permanently.
True or false

Files deleted with rm in the terminal go to a recycle bin or trash folder, just like deleting them normally.

A few small letters after a command like this, written with a dash, are called flags (or options) — they change how the command behaves. -r on rm means "recursive: apply this to the folder and everything inside it". Most commands support several flags, and you can usually see them by adding --help after the command name, e.g. rm --help.

Fill in the blank

Running rm -r on a folder deletes it and everything inside it ____ — there is no recycle bin to recover it from.

Quick check

What does the mkdir command do?

Chapter quiz

The Command Line

10 questions · pass with 60% — just like in the app.

Quick check

What is the "shell" in the context of a terminal?

True or false

Git, package managers, and Expo are fundamentally command-line tools, even when they also offer a graphical app.

Fill in the blank

The command ____ prints the full path of the folder you are currently standing in.

Quick check

Which command lists the files and folders inside your current directory?

True or false

cd .. moves you into the parent of the folder you are currently in.

Fill in the blank

Typing part of a folder name and pressing ____ will auto-complete it for you.

Quick check

What does the mkdir command create?

True or false

Files deleted with rm can be recovered from a recycle bin, the same as deleting them normally.

Fill in the blank

Running rm ____ on a folder deletes it along with everything inside it.

Quick check

What are extra letters after a command, written with a dash (like -r), called?

Keep your streak going in Swipe Coding

Swipe through every level of Ship It on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.

Get the Swipe apps →