-1

I use both windows and Linux and often I got confused when I use command lines...

1>MS-DOS use backslash like C:\Documents and Settings\user_name\Desktop\

2>Linux use slash like /usr/lib

3>URL seems to use slash like http://stackoverflow.com/questions/ask

4>C++/C programmer often use backslash as the escape character like \n or \t or \"

Item 1-3 can be confusing plus the effect of item 4. I am wondering why MS-DOS doesn't use (forward) slash just as everything else, and then we can only use the special backslash as the escape character.

Jasper
  • 11,590
  • 6
  • 38
  • 55
RoundPi
  • 5,819
  • 7
  • 49
  • 75

1 Answers1

2

This has been answered at superuser: https://superuser.com/questions/176388/why-does-windows-use-backslashes-for-paths-and-unix-forward-slashes

Let me quote the gist of it:

MS-DOS 2.0 introduced \ as the directory separator in the early 1980s. The reason / was not used is that MS-DOS 1.0 was already using / to introduce command-line options. It took this usage of / from CP/M, which took it from VMS.

Community
  • 1
  • 1
amaurea
  • 4,950
  • 26
  • 35