5 ms·
Good first attempt. But: counts two links to the same file twice. That is: touch foo; ln foo bar Is this one file or two "links" to the same file? ;-0
by jcynix 3y ago
Good first attempt. But: counts two links to the same file twice. That is:
touch foo; ln foo bar
Is this one file or two "links" to the same file? ;-0
- bandrami 3y agoYou said files, not inodes. Those are two files sharing one inode. If you want to count inodes, specify that in the question.
- jcynix 3y agoI'm not the one who posed the question. And: file, filename, inode, ...? What's what and what's exactly to be counted?
- memetomancer 3y agothe inode is the important thing when all is said and done. It is flexible in that it can contain all the metadata needed to present a file to a process. Sometimes that metadata is a list of blocks in the filesystem. sometimes it points to another inode. I think of it like an old-timey 'card catalog'. You have a bunch of tiny drawers filled with cards. Some of the cards are big and blank spacers with a prominent tab sticking above the normal top edges (Directory). Sometimes you have a card that points to another card elsewhere in the catalog (link). Sometimes you find the details of a specific book on a specific shelf (block data). Point is, they are all cards. The comment essentially asked for a command to say 'how many cards between these two spacers'. It's a "trick" question as old as usenet to spring the distinction between link inodes and list of blocks inodes and say "Ah-HAH!! gotcha", but in reality it's a silly game of jumping levels, misdirecting semantics and prey upon the distribution of understanding in a forum for personal glory. The inode is the item, it is the card that is being counted, no matter what is printed on it. imho.
- deleted 3y ago[deleted]
- preseinger 3y agoabsent further qualifications it is two files