Cd cmd command Last Updated : 30 Sep, 2020 Comments Improve Suggest changes Like Article Like Report Cd is the abbreviation or synonym for chdir. It is a command found inside the Windows Command Processor (cmd) that allows for change of the current working directory of a shell instance. The CWD (Current Working Directory) is a path (of a directory) inside the file system, where the shell is currently working. The current working directory is essential for resolving relative paths. Cd is a generic command found in the Command Interpreter of most operating systems. Description of the Command : Displays the name of or changes the current directory. CHDIR [/D] [drive:][path] CHDIR [..] CD [/D] [drive:][path] CD [..] .. Specifies that you want to change to the parent directory. Type CD drive: to display the current directory in the specified drive. Type CD without parameters to display the current drive and directory. Use the /D switch to change the current drive in addition to changing the current directory for a drive. Some of the output is truncated due to its large length. In order to obtain the above text execute the cd /? command on cmd. It should be noted that chdir is an alias for cd, and therefore can be replaced for all of its occurrences. Using the Command : Displaying the Current Working Directory : Displaying the current working directory is not generally not required on cmd. This is because the default prompt in cmd displays the Current drive and path (CWD) along with the greater than sign ( > ) at all times ($P$G code). But for the sake of completeness, we would be describing it as well. To display the Current Working Directory, execute the cd command without any arguments. Syntax : cd Apparent from the above output, it is not necessary for us to print the cwd as it is already being displayed by the prompt. Throughout the article, we will be using C:\Users as our CWD. Changing the CWD : We can change the Current Working Directory to different paths in the system. The following are the options - 1. To a Directory of Current Drive : To change the working directory, execute command cd followed by an absolute or relative path of the directory you are wanting to become the CWD. Where the path should qualify the following criteria - The Path should be of a Directory. The Directory should be existing. Path can be absolute or relative. If a relative path is used, then the path should be relative to the CWD. Syntax : cd [Path] 2. To a Directory of Another Drive : To change the working directory to another drive, execute command cd /D followed by a path to a directory. The path should qualify the following criteria - The path should be absolute. The path should contain the drive letter followed by a drive qualifier (DRIVE_LETTER & COLON). Syntax : cd /d [Path] 3. An additional way to change the CWD to another drive without the usage of the cd command is to execute the drive letter followed by a colon. Syntax : (Drive_Letter): Comment More infoAdvertise with us Next Article Cd cmd command V vasudev4 Follow Improve Article Tags : Operating Systems Similar Reads cmd | cls command Cls is a internal command found inside windows command interpreter cmd, that is used for clearing the console window. It does so by removing the entry of all previously entered commands, and their corresponding outputs. The command was first introduced in the MSDOS Version 2. Initially it was for co 2 min read cmd | Dir command The dir command is one of the most useful commands while navigating the command line, and is present in its different forms in several operating systems. In this article, we will look at the Dir command and learn several use cases for it.What is the dir Commanddir command in Windows OS is a built-in 9 min read move cmd command The move is an internal command found in the Windows Command Interpreter (cmd) that is used to move files and folders/directories. The command is robust than a regular move operation, as it allows for pattern matching via the inclusion of Wildcards in the source path. The command is a very generic o 5 min read What is CDFS (Compact Disc File System)? Introduction: CDFS stands for Compact Disc File System. Before the era of CDFS, there was no medium for people to store their memories or files that they want to store for the long term purpose. The storing of data and information was a major problem because in that time the world needs a system tha 4 min read Two Level Directory in OS A directory in a computer system is like a container, through which files and folders store data. Just like a room or space is required to keep goods in a shop, similarly a directory is required to store files folder in a computer. In this article, we are going to discuss two-level directories and a 5 min read Like