Navigation

Saturday, January 1, 2011

Why does 'cd' work differently for drives and paths?

This has been a frustrating pet peeve of mine for a while.

When I hope my Windows command line, it starts me out on a network drive, specifically "H:", which of course I rarely have a need to be in. My first instinct, which is always wrong, is to type:
  • H:>cd c:
in an attempt to get to "C:" drive. I may even have include a path like this: "c:\path\to\my\folder".

This always fails, because what Windows expects you to do is this:
  • H:>c:
which will nicely give you the C:> prompt from which you can then navigate.

Why? Is there a way around this? My main problem is that I don't use the Windows command line that often, so I forget the nuance of switching between drives as opposed to switching paths. and why do I have to type the colon?

Unix flavors don't do this. The notion of naming something after an arbitrary letter of the alphabet doesn't even enter into the equation. Everything has a name, and accessing something, be it a file, a folder, or a hard drive, all happens the same way: $cd /This/Is/My/Path (where $ is the command prompt).

[Re-posted from Code Fog]

No comments:

Post a Comment