This question already has an answer here:

If a directory is a special file in unix with filenames and corresponding inodes, is there any way to print the entire contents of this file?

marked as duplicate by Wildcard, HalosGhost, G-Man, countermode, techraf Oct 30 '16 at 7:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You can very well do it just by Vim

  • if I do vim <directory what shows up is a list of contents, but there isn't any inodes. Isn't the directory file supposed to show corresponding inodes? – Austin Oct 30 '16 at 5:28
  • 1
    ls -id /path/to/dir – 8zero2.ops Oct 30 '16 at 5:31
  • I know I can do that if I'm just trying to determine the inodes, but I'm really trying to gain a better understanding of the filesystem. If I read the entire contents of a directory file, shouldn't part of that be the inodes? – Austin Oct 30 '16 at 5:33
  • 1
    i guess the command you are looking for is stat , looking into it man page you all get load of information , see if it helps you , try various switch mentioned in man pages of stat , else we ll dig further – 8zero2.ops Oct 30 '16 at 5:48
  • 1
    @Jake I don't think it's really guaranteed to be a file, you just can think of it as a file with such entries but how exactly it's done one FS level is not defined. Far from an expert on this though, I have no idea how the API for this looks like. – phk Oct 30 '16 at 6:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.