How to Create a CD: Easy Step-by-Step Guide

Written by

in

Understanding the Terminal Power Duo: cd and mkdir

When diving into the world of command-line interfaces (CLI) for the first time, it is easy to confuse or combine terms. While there isn’t a single native command literally named “cd create” in standard operating systems like Linux, macOS, or Windows, beginners often think of this concept when learning how to navigate through folders and make new ones.

In command-line navigation, responsibilities are split between two distinct, powerhouse commands: cd (Change Directory) and mkdir (Make Directory). Together, they form the bedrock of how you move around and build out your computer’s file system without ever touching a mouse.


1. The cd Command: Navigating the Digital Map

The cd command stands for “change directory”. Think of it as your digital pair of walking shoes. Whenever you open a terminal, you are placed somewhere in your computer’s folder hierarchy (known as your current working directory).

  • Moving into a folder: Typing cd Documents shifts your location directly into your Documents folder.
  • Going back up: Typing cd .. takes you one step backward up the directory tree.
  • Returning home: Typing just cd by itself instantly transports you back to your user home directory from anywhere.

2. The mkdir Command: Actually “Creating” Folders

If cd is how you move, mkdir (short for “make directory”) is how you actually create things. If you want to spin up a brand-new folder called projects inside your current location, you would type:

mkdir projects

Once that folder exists, then you can use your navigation tool to step inside it:

cd projects

Combining Forces: The Workflow

While standard shells don’t have a built-in cd create command, developers and system administrators constantly use mkdir and cd in quick succession to set up workspaces.

Many advanced users even write custom shell functions (often added to a .bashrc or .zshrc configuration file) to achieve a true “cd and create” workflow in a single custom command—allowing them to make a directory and jump into it simultaneously.

Quick Summary Cheat Sheet

| Command | What it does | Example |
| :— | :— | :— |
| pwd | Shows your current folder path | pwd |
| ls | Lists files and folders in your current spot | ls |
| mkdir | Creates a new folder | mkdir cool-app |
| cd | Changes your active folder location | cd cool-app |

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *