How to Switch to the D Drive in Windows CMD (When cd Doesn't Work)
Intro
On Windows you sometimes install a program on the D drive instead of C, or need to work on the D drive — for example, if you installed Python on D or need to work with files in a specific folder on D.
Figure 1. cd doesn't move to the D drive
When you open CMD it references the C drive by default. Using cd .. (to the parent directory) only goes up to the top of the C drive; it won't switch to another drive.
Body & Conclusion
Unlike Linux, the Windows filesystem has an independent root per drive (e.g., C:, D:). Linux, by contrast, starts all filesystems from a single root directory (/).
So to move to the D drive in CMD, type the drive letter with a colon: D:.
Figure 2. Switching to the D drive in CMD
In Figure 2, entering
D:at theC:\Users\user>prompt changes it toD:\>.
Reference — the Root Directory of the Linux Filesystem
Figure 3. The root directory on Linux (Ubuntu)
Figure 3 shows moving to the top-level directory with cd / on Linux (Ubuntu). Keep in mind the structural difference between Windows (per-drive roots) and Linux (a single root /).
See also the Linux counterpart (when a tangled PATH breaks commands) in the same OS-settings category.
📦 Migrated from my own Korean blog (my own writing). Original: taehyuklee.tistory.com/21

Comments