1
1
Please explain me difference between:
x:/somepath/
/x/somepath/
x:\somepath\
....
And is universal path write for all OS? I know the windows use
x:/somepath/
1
1
Please explain me difference between:
x:/somepath/
/x/somepath/
x:\somepath\
....
And is universal path write for all OS? I know the windows use
x:/somepath/
0
Please look at below one by one, I have included images too.
First you will find command execution related to Git Bash then CMD.
SJV@DESKTOP-UNO8EI3 MINGW64 ~
$ clear
(base)
SJV@DESKTOP-UNO8EI3 MINGW64 ~
$ cd C:/Users/SJV/Desktop
(base)
SJV@DESKTOP-UNO8EI3 MINGW64 ~/Desktop
$
(base)
SJV@DESKTOP-UNO8EI3 MINGW64 ~
$ cd /c/Users/SJV/Desktop/
(base)
SJV@DESKTOP-UNO8EI3 MINGW64 ~/Desktop
$
(base)
SJV@DESKTOP-UNO8EI3 MINGW64 ~/Desktop
$ cd c:\\Users\\SJV\\Desktop
(base)
SJV@DESKTOP-UNO8EI3 MINGW64 ~/Desktop
$ cd ~
(base)
SJV@DESKTOP-UNO8EI3 MINGW64 ~
$ cd c:\Users\SJV\Desktop
bash: cd: c:UsersSJVDesktop: No such file or directory
(base)
SJV@DESKTOP-UNO8EI3 MINGW64 ~
$
C:\Users>cd SJV
C:\Users\SJV>cd C:\Users\SJV\Desktop
C:\Users\SJV\Desktop>
C:\Users\SJV\Desktop>cd /c/Users/SJV
The system cannot find the path specified.
C:\Users\SJV\Desktop>
Well, you're kind of mixing syntax between OSs. It's better to learn the syntax for each OS, and the syntax for a URI for a file, that's another one. Then you can see ok so windows might also allow forward slashes. Cygwin uses a linux style syntax. so – barlop – 2018-01-06T07:38:27.130
1the c:\ one is windows.. the
/c/blah
is something you might see in cygwin it follows linux syntax. And thec:/
is just that windows allows forward slashes too but IMO if in windows better to use proper syntax of backslash. There isn't really a universal. – barlop – 2018-01-06T07:40:43.760Thanks for answer, for example i use shell scripts on windows and executing it from MINGW console , whom is better syntax to write path in this situacion ? – Andrej – 2018-01-06T07:45:48.987
Crossposting: https://stackoverflow.com/q/48125088/3776858
– Cyrus – 2018-01-06T10:44:05.263@Andrej I just started a mingw console and it says
C:\Windows\system32>
so what do you think? obviously if the prompt saysc:\......>
then you use that syntax with the 'drive letter' the colon and the backslashes. If it says dollar like cygwin then you use the linux style syntax with the paths that .cygwin makes for you. Try typingcd
it shows you the path that's the syntax you use for paths! – barlop – 2018-01-06T16:35:03.567