+ 4
Why does Windows use \ and Linux use /?
15 Answers
+ 11
Thomas in order to find answer to this question, I had to dig down a bit in history of these operating systems, and here is what I found.
Using "/" as directory seperator is an UNIX convention{ thus all UNIX-like OS including macOS and Linux use this}
But microsoft-DOS had a problem, they already used the "/" as a "switch" character as earlier version of DOS was not having concept of directories, but when later version of DOS intorduced the support for directories they had to go for some other character as directory seperator { maybe to support backword compatibility with older DOS versions } so they went with "\".
Now as Windows was initially built on top of DOS thus have to keep its lagacy of using "\" in file systems.
+ 4
It comes from early DOS versions , which didn't have directories (after all they were created for microcomputers which had small storage space, generally provided by a floppy disk) so they didn't use a directory separator. They used character '/' to prefix command line switches. So when directories finally came they had to use a different separator. Later this convention was preserved in windows to keep (at least some) backwards compatibility.
https://docs.microsoft.com/en-us/archive/blogs/larryosterman/why-is-the-dos-path-character
+ 3
Arsenic and Volodymyr Chelnokov Ok that makes sense.
+ 3
Thomas it wasn't Torvalds who chose / it was used much before in the Unix OS.
+ 3
I believe Arsenic has the perfect answer.
+ 2
Mikiyas I wasnt asking which was better; I was asking why Linux uses / and why windows uses \
+ 2
Shail Murtaza I know that the creator can do what they want, but I want to know why Bill Gates chose \ and why Linus Torvalds chose /
+ 2
Sonic Yeah I know it wasnt him I just couldnt remember who invented Unix lol
+ 2
Thomas OK. Unix was invented in Bell labs by Ken Thompson, Dennis Ritchie and others.
+ 1
You can also use / in Windows but you can't use \ in Linux.
Linux and Windows are not the same OS and there creator are also not the same.
Creator can do whatever he wants to do.
+ 1
Thomas How I know?
+ 1
Thomas According to me they doesn't worry about it more then you.
+ 1
Shail Murtaza I didnt say you knew, I was just saying that I was asking that.
+ 1
Sonic Oh ok