Cmd cd Command Tutorial

The cmd is the short form of the command-line interface or MS-DOS or Command Prompt. The cd command is one of the most popular commands used in Windows, Linux, and MacOSX operating systems. The cd command is the short form of the change directory . As its name suggests the cd command is used to change the current working directory via the command-line interface.

Open CMD (Command Prompt or MS-DOS)

The cd command can be executed via a command-line interface like MS-DOS or cmd.exe. In order to run cd on cmd, the MS-DOS command prompt should be opened. MS-DOS can be opened in different ways but the easiest and practical way is using the Start Menu . Just type cmd to the start menu like below.

cmd
Open CMD (Command Prompt or MS-DOS)

Alternatively the Windows run can be used to opend cmd. First press WIN+R keys at the same time to open Windows run. Then type cmd.exe and press enter to open Command Prompt.

Open CMD (Command Prompt or MS-DOS)
cmd.exe

cd Command Syntax

The cd command has the following simple syntax where the path we want to navigate can be provided as parameter.

cd PATH
  • PATH is the directory path which is changed to. The PATH can be relative path or absolute path.

Print Current Working Directory

The cd command can be used to print current working directory . The current working directory or CWD is the currently active path or used path. Without providing any parameter or option to the cd command the current working directory or path is displayed.

cd

Change Directory

The main purpose of the cd command is changing the current working directory or current working path. To change the current directory the new path should be specified as parameter to the cd command. In the folllowing example we change directory to the Downloads.

cd Downloads

Change Directory Using Relative Path

The cd command can be used with the relative path. Relative path is provided according to the current working directory as the provided path information. In the following example the current working directory is C:\Users\ismail and using the relative path Downlaods we change the directory to the C:\Users\ismail .

cd Downloads
Change Directory Using Relative Path

Change Directory Using Absolute Path

The cd command can be used with the absolute path. The absolute path is specified by providing the complete path without relation with the current working directory etc. In the following example we navigate to the C:\Users\ismail\Downloads .

cd C:\Users\ismail\Downloads
Change Directory Using Absolute Path

Change Drive Letter (Partition)

The cd command can be used to change drive letter where the C:\ is the default and most popular drive letter used in Windows. This can be also called as changing the partition. In the following exampl we change drive letter or partition to the Z:\.

cd Z:\

Leave a Comment