Tutorial of various MS-DOS commands. For instructions on how to
open a DOS command prompt window, see: How to Open Command Prompt.

Note: Click here for newer version of this tutorial

Monday, June 30, 2008

DOS Commands :: cd (change directory)

DOS Commands :: cd (change directory)

When you are using a Microsoft DOS command window, MS-DOS works on one directory at a time. The "current" directory is indicated as part of the command prompt.

For example, the command prompt "C:\mystuff\ebooks>" means that the current directory is the "ebooks" directory which is located inside the "mystuff" directory on the c: drive.

Use the cd command to make a different directory the "current" directory ("cd" is short for "change directory").

The command can be typed as either:

cd directory

or

cd drive:directory

For example, "cd \mystuff" will make "\mystuff" the current directory. To get to the "root" (top level directory) of your c: drive, type cd \

Note: To see what directories are available for you to cd into, use the dir command. And to make a new directory, use the md (or mkdir) command.

You can also type cd .. (the two dots are required) to back out one level out of the current directory. For example, if the current directory is "C:\mystuff\ebooks>" then typing cd .. will change the current directory to "C:\mystuff>"

No comments: