A guide to the Beginner tutorial: the core commands for moving around and managing files, pwd, ls, cd, mkdir, touch, and rm, and how they fit together.
This tutorial covers the six commands you reach for constantly: finding where you are, looking around, moving, and creating or deleting files. Master these and the file system stops being a mystery.
Knowing where you are: pwd and ls
pwd # print the full path of the current directory
ls # list the files and folders here
pwd ("print working directory") answers "where am I?", and ls answers "what is here?". You will run these reflexively before doing anything else.
Moving around: cd
cd projects # go into the projects folder
cd .. # go up to the parent folder
cd # go home
cd ("change directory") moves you through the file system. Combine it with ls to explore: list, move in, list again.
Lost? Run pwd to see exactly where you are, then cd with no argument to return home and start fresh.
Creating things: mkdir and touch
mkdir notes # create a directory named notes
touch notes/todo.txt # create an empty file
mkdir makes folders; touch makes empty files (and updates timestamps on existing ones). These are the building blocks for organizing a project.
Removing things: rm
rm todo.txt # delete a file
There is no undo. rm removes a file immediately, with no trash bin. Double-check the name before you run it. Practicing here is safe because WebTerm uses a virtual file system, but the habit of checking first is worth building now.
How they fit together
A normal session looks like: pwd to orient, ls to look, cd to move, mkdir/touch to create, and rm to clean up. Every later tutorial assumes you can do this without thinking.