🗂️

Creating Directories in Bash

Jul 19, 2025

Overview

This lecture covers how to create directories in Bash, including handling spaces in directory names.

Creating Directories in Bash

  • Use the mkdir command in Bash to make a new directory, similar to making folders in Windows.
  • Example: mkdir mycoolfolder creates a folder called "mycoolfolder" in the current directory.
  • To verify creation, check the folder list (e.g., on your Desktop).

Handling Spaces in Directory Names

  • In Bash, escape spaces in directory names with a backslash (\).
  • Example: mkdir my\ cool\ folder creates "my cool folder".
  • Alternatively, use quotes to encompass the name: mkdir "my cool folder".

Key Terms & Definitions

  • Bash — a Unix shell and command language for Linux and other systems.
  • mkdir — command to make a new directory.
  • Escape character — a character (like backslash) used to indicate the next character should be treated differently.
  • Quotes — enclose file or folder names containing spaces to be recognized as a single item.

Action Items / Next Steps

  • Practice creating directories with and without spaces in Bash.
  • Review command usage for handling spaces in folder names.