0

When I do a directory listing of a python installation the include directory appears twice and each one has a different inode.

╰─○ ls -i1
2282047 bin
2641630 include
2642559 include 
2282048 lib
2641850 share

I assume that their contents may be different as the inodes are different.

Is there away to use the ls command to use the inode not the directory name so I can check them individually?

When I execute ls include I have no idea which directory is listed.

vfclists
  • 7,215
  • 14
  • 51
  • 79

1 Answers1

3

It is not possible to have directories or files with duplicate names in Unix and so there would be no reason for ls to have an option to handle that use case.

The reason you are seeing what appears to be duplicates is because one directory actually has a trailing space (inode 2642559).

BusyBox's ls, unlike GNU's ls, doesn't quote names of directories and files that have spaces so it can be easy to misinterpret them.

Snake
  • 1,580
  • 1
  • 5
  • 16
  • You are right. I thought `ls` quotes filenames when there are spaces in them. Perhaps the version on the Debian Stretch doesn't quote files names with spaces in them or requires an additional option. – vfclists Oct 11 '22 at 04:50