Difference between forward and backslash

JBone picture JBone · Aug 4, 2011 · Viewed 22.5k times · Source

What is the difference in using a forward slash and backslash in navigating file systems. Also what is the difference between ./ and ../?

Answer

sepp2k picture sepp2k · Aug 4, 2011

Well, in most languages backslashes need to be escaped in string literals, slashes do not. Further backslashes only work on Windows, while slashes work pretty much everywhere.

On the other hand, when passing path names as arguments to Windows programs, using slashes might not work because many Windows programs use slashes to signify command line flags, so you need to use backslashes.

On . vs. ..: . is the current directory, .. is the parent directory.