$
Learn Linux handbook
en
XP:0
Quest 16Quoter
+170 XP

Handling Spaces in File Names

Launch Interactive Terminal for This Quest→No installation required • Runs fully in browser

Concept & Overview

If you tell a robot to "paint my bedroom blue", it needs to know whether "my bedroom" is a single place or if "my" and "bedroom" are two different instructions. Linux uses spaces to separate commands from their arguments. So if you run mkdir my folder, Linux thinks you want to create two separate folders: one named "my" and another named "folder"!

- To tell Linux that a name with spaces is a single item, we must wrap it in quotes ("my folder" or 'my folder') or use a backslash to escape the space (my\ folder).

Let's handle names with spaces. Create a folder named "my code" in your home directory, and then create an empty file named "my task" inside it.

Command Syntax Reference

Command / SyntaxDescription
mkdir "my code"Create a folder with a space in the name
touch "my code/my task"Create a file with a space in the name

Verification Objectives

These conditions will be automatically verified when you run commands inside the interactive terminal simulator:

  • ○
    Create directory "my code"
  • ○
    Create file "my task" inside "my code"

Ready to complete Quest 16?

Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.