EmilyAvon EmilyAvon - 6 months ago 24
Linux Question

What happened in linux bash when I use "cd //"?

I find an interesting thing about linux bash.
After I typed

cd //
in linux bash.Guess what happend?
The directory became
,then I
,the directory is
But I don't know what happend to the bash.


That's what should have happened.

When you did cd //, the system changed your directory to /. So pwd will tell you (correctly) that you are in //. (Refer to the answer linked in the comments to understand why multiple slashes are the same as a single slash).

If you do an ls after your cd // command you'll see a lot of folders that are mounted on /.

Nothing 'happened to the bash'.

If you do a cd , it will take you back to your more famliar $home.