Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between forward and backslash [duplicate]

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

like image 599
JBone Avatar asked Aug 04 '11 18:08

JBone


1 Answers

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.

like image 128
sepp2k Avatar answered Oct 15 '22 23:10

sepp2k