Categories
Linux Tutorial Series

Linux Tutorial Series – 139 – How files and directories are represented internally – inodes

Here is the video version, if you prefer it:

Let’s clear out one more conceptual thing before we jump into other things – how are files and directories represented internally.

See, a usual filesystem you will find on Linux consists of a pool of data blocks where you can store data and a database system that manages the data pool. The database contains entries which describe the file type, file permissions and where the file is stored in the data pool. (Ward, 2014)⁠ These database entries are called inodes. Interestingly, the inodes don’t store the file name. (“Where are filenames stored on a filesystem?,” n.d.)⁠

Files and directories are represented as inodes. This is imporant to keep in mind as we progress, although in my explanations I try to review some key concepts before explaining new ones.

Hope you learned something new!

References

Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Page 87

Where are filenames stored on a filesystem? (n.d.). Retrieved February 29, 2020, from https://unix.stackexchange.com/questions/117325/where-are-filenames-stored-on-a-filesystem

Categories
Linux Tutorial Series

Linux Tutorial Series – 19 – Directories and files

Here is the video version, if you prefer it:

In Linux, you will find both directories and files. Think of directories like folders in Windows or like drawers or folders in everyday life – they are used to store files within them and give structure to your files. (“Directory (computing),” n.d.)⁠ Files are resources for storing information. (“Computer file,” n.d.)⁠

Directories also have a hierarchy. So we can have directory1/directory2. That means that directory2 is a child directory of directory1. Imagine this as a folder within a folder. When we list the “hierarchical trajectory” from some directory to some other directory, we are talking about a path. (“Path (computing),” n.d.)⁠

Hope you learned something useful!

References

Computer file. (n.d.). Retrieved February 23, 2020, from https://en.wikipedia.org/wiki/Computer_file

Directory (computing). (n.d.). Retrieved February 23, 2020, from https://en.wikipedia.org/wiki/Directory_(computing)

Path (computing). (n.d.). Retrieved December 29, 2019, from https://en.wikipedia.org/wiki/Path_(computing)