File types, inodes and links
The seven file types shown by ls -l, what an inode holds, the directory as a table of names, hard and symbolic links, the link count, and the failures that follow from them.
- 25 cards
- 5 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- The numbers
- Scenarios
A few cards from the deck
Inode: what is it?
Show the answer
The file system structure that holds a file's metadata (owner, permissions, size, dates, location of the data), but not its name.
The name lives in the directory, which maps it to an inode number;
ls -ishows that number andstatdetails the rest.What does the last command print?
```bash
echo bonjour > a
ln a b
rm a
cat b`bonjourcat: b: No such file or directory- An empty line: the content went away with
a cat: b: Stale file handle
Show the answer
bonjourbis a second name for the same inode.rm aremoves one name and lowers the count from 2 to 1: the data stays readable throughb.A directory is a table that maps … to … numbers.
Show the answer
A directory is a table that maps names to inode numbers.
That is why renaming or moving a file within one file system copies nothing: a directory entry changes, the inode stays the same.
Hard link: what is it?
Show the answer
An extra directory entry that points straight at the inode of an existing file: two names, one file.
Neither name is the original. The data only goes away with the last name, and the link cannot cross a file system.