Hi there !
So basically, in a bid to learn a lot (one of my new year resolutions), and commit this knowledge to muscle memory, I have decided to get into briefly talking about things I have been looking into. I hope I can keep this energy till the end of the year and see where it brings me.
Technically, this is not an article to teach you all about the linux filesystem, its more like a summary of what I learnt when I was busy gathering knowledge about this topic. That said, I think I should get down to business.
What is a File System ?
A file system basically refers to the format in which a hard drive stores files. There are different file systems particular to different operating systems. There are a couple of file systems, but i think the most used is the ext4 file system.
A file system consists of folders/directories that contain more folders or files. Itβs basically a network that links files and folders on your computer. It can be represented graphically using a something like a family tree.
Wait, Wait. I already typed "a family tree" before I went in search of images that could describe a family tree, but the picture above does not totally describe what I really meant unless its rotated.
Something of this sort ππ½
Now, that's more like it. !
Observing this inverted family tree, you would realize that starting from the top is just a single node. This node represents the root. It is represented using /. In most of the places I checked to grab some knowledge, they always mentioned that this root ( / ) should not be mistaken for the /root directory.
" / " and " /root " => Root and Root ...
I think the difference between " / " and " /root " is easily to explain, " /" is the head or main root (root) of the whole linux file-system while " /root " is the admin's user-directory which is the same /home/ on your PC.
I hope that was clear enough... if it wasn't , this might help.
Moving on, still using the inverted family tree as a reference, under the ' / ' node, are a couple of subdirectories. Note that each node is a directory, but is a subdirectory of the node that birthed it.
You can create nodes (folders / directories) of your own as well, but by default, the " / " directory comes with some folders. Most of them contain different files used by the system in general for different purposes. I would mention a few of these folders and talking about what each of them contain.
- /bin - stands for Binary. It contains programs on the machine/computer system.
- /boot - basically contains the files required to boot/start up the system.
- /etc - contains all sorts configuration files for the system.
- /dev - contains files and folders for the devices used or connected to the computer system.
- /home - contains all of the users files. This is usually the default directory when you launch a terminal window.
- /lib - contains folders and files for libraries used by different applications on the machine.
- /opt - contains stuff for extra programs installed on a computer system.
- /tmp - contains temporary files used by the machine.
- /root - the root user's home directory is located here. I would be repeating that it should not be confused with the " / " directory.
- /var -this is where logs, backups, caches and temp files for the system are stored.
- /usr - contains system resources used by the machine like icons. You might think usr stands for user, but it's actually "Universal System resources."
Quickies
There are some stuff I learnt that I really don't know how to title, so here's just a section to drop them off as points.
The linux file system is case sensitive unlike the windows file system (Windows makes use of the FAT, NTFS, exFAT, Live File System and ReFS file systems).
Files are hidden by placing a dot in front of the filename. Reveal them using CTRL + H.
Thanks for reading till the end. In my next adventure, I would be looking into Bash Scripting. I hope it turns out well so I could come back on here to scribble away.