Skip to main content
Post Closed as "Duplicate" by Thomas Dickey, Gilles 'SO- stop being evil' bash
added 109 characters in body
Source Link
tuskiomi
  • 127
  • 1
  • 9

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 .. -> /

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.

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 .. -> /

Source Link
tuskiomi
  • 127
  • 1
  • 9

What's the difference between the pile paths '/' and '//'?

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.