I noticed in Ubuntu that the following commands go to seemingly different locations in the file system, but the locations have the same files:
cd /
cd //
ls-ing from both locations produces the same result:
vm@virtual-machine://$ ls
bin dev initrd.img lib64 mnt root snap sys var
boot etc initrd.img.old lost+found opt run srv tmp vmlinuz
cdrom home lib media proc sbin swapfile usr
Is there a distinction in the behaviors in these to seemingly different, yet the same file paths?
Note: 'cd ///
' is not a valid file path, but '//usr/
' and '//bin/
' are valid paths.
Note-2: So running cd .. in in each points to themselves, so // -> cd .. -> //
and / -> cd .. -> /
///
is a valid path (which is equivalent to/
) andcd ///
is a valid command. What do you mean by “'cd ///' is not a valid file path”? – Gilles 'SO- stop being evil' Oct 11 '21 at 20:47cd //
whereas macOS could brick your computer, FreeBSD could do nothing at all, NetBSD could treat it as/
, Solaris could use it for file sharing, HP-UX could use it for accessing windows on the desktop, … – Jörg W Mittag Oct 11 '21 at 20:48