Skip to content
DoingCamp CS

Make it comfy

Lesson style

Quick mode shows the key picture, a summary and the practice. Good for a refresher.

Theme
Font

Both fonts are designed to be easy to read. Some readers with dyslexia prefer Lexend.

Text size
Spacing
Animations

Lesson 2 of 16 · about 13 min

Files and folders

Create, copy, move, rename and delete files and folders by typing. Plus how to read file permissions, the rules for who can read, change or run each file.

🧭 What you need first: The shell

The story

Your desktop is a mess: photos from three trips mixed together, a “final_FINAL_v2.docx”, and a hundred screenshots. With a mouse you’d drag files one by one into new folders.

In the shell you do it with a few short commands: make a folder, move everything that matches into it, rename what’s badly named, delete what you don’t need. And once you know the commands, you can do it for a thousand files as easily as for three.

One warning, in a friendly way: rm deletes immediately. There’s no Recycle Bin, no “are you sure?”. That’s why programmers pause for a moment before pressing Enter on an rm. (In this pretend computer, you can always press Start over.)

Another way: tidying a filing cabinet

mkdir is getting a new folder for the drawer. mv is moving papers into it (or re-labeling them). cp is making a photocopy. rm is the shredder.

Play with it

Make, move and copy

Try these one at a time and watch the file map: mkdir trip, mv beach.jpg trip/, cp notes.txt notes-backup.txt, mv notes-backup.txt old-notes.txt, ls -l.

Type a command below and press Enter. Try: ls

you@crayon:~$

Files

🏠 ~ (home) ← you are here

  • 📄 beach.jpg
  • 📄 junk.tmp
  • 📄 notes.txt
Name it

The real words

mkdir, touch, cp, mv, rm:

CommandDoesExample
mkdir namemake a folder (-p makes missing parents too)mkdir -p work/2026/reports
touch filecreate an empty file (or update its timestamp)touch todo.txt
cat fileprint a file’s contentscat todo.txt
cp from tocopy (-r for folders)cp notes.txt backup.txt
mv from tomove, or rename if it stays in the same foldermv draft.txt final.txt
rm filedelete (-r for folders). Permanent.rm junk.tmp
  • Wildcards match many names at once: *.jpg means “every name ending in .jpg”. mv *.jpg photos/ moves them all.
  • Permissions: ls -l shows something like -rwxr-xr--:
    • The first character: - for a file, d for a folder.
    • Then three groups of three: the owner, the group, and everyone else.
    • r = read, w = write (change), x = execute (run it as a program, or enter it if it’s a folder). A - means “not allowed.”
    • chmod +x script.sh makes a file runnable (lesson 4).
  • Names with spaces need quotes: mv "my file.txt" myfile.txt. Many programmers avoid spaces in file names for this reason.
Build it

Tidy the desktop

Make a folder called photos and move both .jpg files into it. Rename final_FINAL_v2.txt to report.txt. Delete junk.tmp.

Type a command below and press Enter. Try: ls

you@crayon:~$

Files

🏠 ~ (home) ← you are here

  • 📄 beach.jpg
  • 📄 final_FINAL_v2.txt
  • 📄 junk.tmp
  • 📄 mountain.jpg
  • ⬜ There is a photos folder
  • ⬜ beach.jpg is inside photos
  • ⬜ mountain.jpg is inside photos
  • ⬜ my report
  • ⬜ final_FINAL_v2.txt is gone
  • ⬜ junk.tmp is deleted
Challenge

Read the permissions

ls -l shows: -rwxr-x--- deploy.sh. Who can run this script?

Remember it

How do you rename notes.txt to ideas.txt in the shell?

Got it?

Finish the lesson to color it in on your map and collect its concept cards.

Did this lesson click?