PDF download Download Article
Go up a folder in the command prompt using the "cd" command
PDF download Download Article

Do you need to go back a directory when browsing through the Command Prompt? Folder (also called "directory") navigation in Command Prompt might seem challenging at first, but once you learn some simple commands, it'll be easy to go back to a previous folder or move up a directory. This wikiHow article teaches you how to go back a directory in CMD as well as other useful navigation commands.

Quick Commands to Go Back in Command Prompt

  • To go back a directory, type cd.. and press Enter.
  • To go back multiple directories, type cd, followed by a space, then ..\ for each directory you want to go back (i.e., cd ..\..\..\).
  • Type cd \ to go back to the root of the current drive.
Section 1 of 2:

How to Go Back in Command Prompt

PDF download Download Article
  1. Type cd.. and press Enter to go up one directory.[1]
    • You don't have to enter a space between cd and .., but you can if you'd like. Both cd.. and cd .. will go back a directory in Command Prompt.
    • This command will also work in Windows PowerShell in the Windows Terminal app.
    • If you're using the Linux or macOS Terminal, you can use cd .. to go back one directory. Note that you must use a space in the Terminal between cd and .., unlike in Windows.
  2. 2
    Go back multiple directories. Type cd ..\..\ and press Enter to go back multiple directories. Fop each level you want to go back, add a ..\.
    • For example, if you want to go back three directories, you would type cd ..\..\..\ and press Enter.
    • You can use a forward slash “/” or a back slash “\” for this command.
    Advertisement
  3. Type cd \ and press Enter to go back to the root of the drive you're in. If you enter this command while in your C: drive, you will go all the way back to the “C:\>” directory.[2]
  4. Advertisement
Section 2 of 2:

Other Navigation Commands

PDF download Download Article
  1. 1
    View all subdirectories in the current directory. To do this, type dir and press Enter.
  2. 2
    Go to another directory. Type cd [directory name] and press Enter to enter the specified directory.
    • For example, you could type cd Documents to change to your Documents directory from your user directory. However, this command would not work if you are not in a directory with the “Documents” directory.
    • If the directory you want to enter is on a different drive or not in a subdirectory of the current folder, specify the full path. For example, if you're in your user folder and want to go to D:\Music, you'd enter cd D:\Music.
    • If the directory name has spaces in it, put the directory name in quotation marks. For example cd “Program Files (x86)”.
    • You can jump forward multiple directories by typing the path to it from your current directory, separating each directory name with a backslash. For example, from your root C: drive directory, you could type cd “Program Files (x86)\Steam\steam\games” and press Enter to open your Steam games directory.
  3. 3
    Change to a different drive. Type [drive letter]]: and press Enter to change to a new drive or partition. You can do this from any directory.
    • For example, if you have a separate D: drive that you want to change to, you would type D: and press Enter.
  4. While in the command prompt, you can view any files on your computer in a text-only format by typing in the location (usually a disk) and the file name (including any extensions). If you want to launch a program within your current directory, type the executable file name (with the “.exe” extension) and press Enter.[3]
  5. 5
    Use the pushd and popd commands. The pushd command allows you to change to a new directory while storing your current directory in memory. popd returns you to your current directory.[4]
    • For example, from your user directory, you could type pushd documents\programs\python to move to a folder for your Python programs and save your current directory. Then, when you want to return to your current directory, you would type popd and press Enter.
  6. Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Did this article help you? Say thanks with a small tip.
icon
$1
$3
$5
Leave a Tip
Support our mission to help everyone in the world learn how to do anything.

Tips

  • When you start typing the directory name, you can press Tab to autocomplete the directory name.
  • To quickly change to a specific directory, type cd and then drag and drop the folder you want to change into CMD from File Explorer. Then press Enter.
  • If you get an “access denied” error, try running CMD as an administrator. To do so, right-click CMD in the Windows Start menu and click Run as administrator. You must be logged into an administrative account.
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

Video

You Might Also Like

Open a Folder in Cmd Open a Folder in Windows Command Prompt (CMD)
Change Directories in Command Prompt Navigate to a Different Folder in the Command Prompt
Use MS DOS Use MS DOS
Navigate the Windows Directory Navigate a Windows Directory or Folder: 3 Ways
Copy Files in Command Prompt2 Easy Ways to Copy Files in Command Prompt
Run a Batch File from the Command Line on Windows Execute a Batch File from the Command Line (CMD)
List Every File on Your Hard Drive See Every File On Your Computer in CMD (Command Prompt)
Use the Command Terminal in Windows 10 to Move and Copy Files/Folders Use the Windows 10 CLI to Move & Copy Files or Folders
Run a Program on Command Prompt Run a Program at the Windows Command Prompt: 2 Ways
Find All Commands of CMD in Your Computer Display and Use CMD Commands: A List and Guide
Run an EXE File From Command PromptRun an EXE File From the Command Prompt on Windows 10 & 11
Open the Command Prompt in Windows6 Simple Ways to Open the Command Line in Windows
Copy Files to USB Using CMD Copy Files to a USB Using Command Prompt (CMD)
Create and Delete Files and Directories from Windows Command PromptCreate and Delete Files and Directories from Windows Command Prompt
Advertisement

About This Article

Travis Boylls
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Travis Boylls. Travis has been a tech writer at wikiHow for more than 10 years. He has also worked in technical support for Dish Network and AT&T Wireless. He studied graphic design and web design at Pikes Peak Community College. He specializes in Windows, macOS, Linux, Android, iOS, and video game consoles. Travis has had a fascination with computers and technology that goes all the way back to childhood. He is proficient in all manner of software and computer operating systems. This article has been viewed 499,745 times.
How helpful is this?
Co-authors: 4
Updated: June 25, 2026
Views: 499,745
Categories: Command Prompt
Article SummaryX

1. Open the Command prompt.
2. Type cd.. Into the prompt.

Did this summary help you?

Thanks to all authors for creating a page that has been read 499,745 times.

Is this article up to date?

Advertisement