LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cd // ???? (https://www.linuxquestions.org/questions/linux-newbie-8/cd-802281/)

davidstvz 04-15-2010 05:52 PM

cd // ????
 
I did this by accident and it actually took me to a directory with nothing in it. cd .. took me to root.

I did it in cygwin and did a listing, and it listed a file called 'hurricane' (after a significant delay) but couldn't access it. cd .. left me in the directory // though.

What's going on here?

AlucardZero 04-15-2010 07:07 PM

hurricane is the name of your Windows computer. On real Unixes, cd // should just take you to /.

John VV 04-15-2010 07:12 PM

in cygwin and MinGW using cd to \\ ( or //) will take you to thew MS Windows C drive ( the default )

but this also depends on what you have listed in the "/etc/profile "
for ex in mingw or cygwin if i do this"
cd /src" i go to
C:\\ GnwWin32/Mingw/src

and if i do this
cd /
i go to
C:\\GnuWin32/Msys/home/john


what did you set the files to ???

davidstvz 04-16-2010 09:19 AM

I've mostly satisfied my curiosity here. I don't know why a Linux computer would want to take you to root when you go to // but call it // instead of just / ...some kind of backwards compatibility I guess?

Quote:

Originally Posted by AlucardZero (Post 3937042)
hurricane is the name of your Windows computer. On real Unixes, cd // should just take you to /.

hurricane is actually not the network name of my windows computer, but I have a vague memory of putting that in somewhere. It doesn't really matter, I was just curious.

I looked in etc profile briefly, but didn't find any lines relating to this. Again, it doesn't really matter I was just curious.

catkin 04-16-2010 09:33 AM

Quote:

Originally Posted by davidstvz (Post 3937661)
I've mostly satisfied my curiosity here. I don't know why a Linux computer would want to take you to root when you go to // but call it // instead of just / ...some kind of backwards compatibility I guess?

Probably just convenience. "//" anywhere in a path cannot be valid so most (all?) programs simply silently treat it as "/". Hey -- we bad typists need all the help we can get!


All times are GMT -5. The time now is 07:15 PM.