MS-DOS and Windows command line users
When typing the cd.. or cd .. (with a space) command, this moves the directory back one directory, also known as the parent directory. As shown below, if you’re in the \Windows\System32 directory, using the cd.. command takes you back to the Windows directory.
- MS-DOS and Windows command line users.
- Linux and Unix users
C:\Windows\System32>cd.. C:\Windows>
The cd\ command takes you back to the root directory of the current drive. As shown below, if you were in the same \Windows\System32 directory and typed the cd\ command, it would take you to the C:\ directory.
You can also type three or more periods in a row to move back multiple directories. For example, typing cd… moves back two directories.
C:\Windows\System32>cd
C:>
Linux and Unix users
When typing the cd .. command (need to have a space between cd and ..), this moves the directory back one directory, also known as the parent directory. As shown below, if you’re in the /public_html/cgi-bin directory, using the cd.. command takes you back to the public_html directory.
You can also type the path after the cd. For example, to get to the C:\Windows\Temp directory type: cd\windows\Temp to get into that directory regardless of where you are on the C: drive.
[~/public_html/cgi-bin]# cd .. [~/public_html]#
The cd / command takes you back to the root directory of the current drive. As shown below, if we were in the same /public_html/cgi-bin directory and typed the cd / command it would take you to the / directory.
[~/public_html/cgi-bin]# cd / [/]#
Unless you have root rights or proper permissions you cannot list the files in this directory. If you want to get to the root home directory (~) type: cd ~ (tilde) at the prompt.
Related information
- MS-DOS and Windows command line cd command help.
- How to use the Windows command line (DOS).
- Linux and Unix cd command help.
- See our cd definition for further information and related links.
- MS-DOS and Windows command line help and support.
- Linux help and support.
- Software help and support.