The Linux File System...for humans

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Good video, but a few nitpicks... should probably mention, I think, two of the most important files/folders in /etc/ besides configs namely /etc/fstab telling your system to mount certain drives on boot and /etc/init.d for system services ran by your init. Furthermore when he mentioned pid 1 he said Systemd where it's more accurate to just say your init system commonly Systemd. Maybe worth mentioning the other filesystems available, like ext4. Lastly, maybe worth mentioning that some people keep /boot/ separate and therefore it is unmounted after boot.

👍︎︎ 4 👤︎︎ u/NickHack997 📅︎︎ Jan 06 2019 🗫︎ replies

Excellent video

👍︎︎ 2 👤︎︎ u/psierak 📅︎︎ Jan 06 2019 🗫︎ replies
Captions
what's going on engineers this videos on the Linux file system optimized for humans specifically we're going to examine is all the folders in the root of the file system along with what you might find in each folder and then some of the special files that you're likely to come across let's get to it when we're talking about the root of the file system what we're describing is the root mount point and that's going to be just slash CD for it slash if you're coming from Windows you're probably wondering well where's the C Drive or the D Drive e Drive F Drive and so on and Linux doesn't do like named the drives like like Windows does the other thing you probably noticed is that it's all forward slashes whereas in Windows it uses back slashes for everything so let's check out what's in here so this is all the contents of the root folder there's a number of folders in the root folder and we're gonna cover a lot of these there are a couple that are specific to my distro that we won't cover so we're only going to cover the common ones that are common across Linux as a whole and it's gonna be these ones here they were going to look at the first floor to look at scan abhi slash bin this is going to be a folder that contains common executables they're gonna be shared for everyone on the system whether that's normal users or administrative users so we'll go to CD slash bin I'll do LS and many of these are just extremely common you know like CP for copying a file you know RM for removing a file RM dara for moving a directory and so on regardless of the user type everybody can access all of these the next folder is slash boot that's going to contain the actual Linux kernel as well as some of the boot configuration so if we go into CD slash boot we look in here we see things like the initial Ram disk images the actual compressed Linux kernel and then the grub folder inside the grub folder you get several more files that are related to the actual booting of the system and one in particular is going to be grub dot CFG that will let you configure what shows up in your list of kernels to select from as you boot your system and then if you were to dual boot with Windows you would actually see a window entry inside there as well one last note about the initial ramdisk and the actual compressed kernel is that in the root directory you can see that there are two symlinks one is the init our deed IMG and then the other one and those are similar to the RAM disk and the compressed kernel next folder is slash dev that's going to contain files which point to both physical and pseudo devices keep in mind that on linux everything is a file so there's even files that point to a physical hardware and we'll see an example of that in a second so we're gonna look at one example of each we're gonna look at one file that points to a physical piece of hardware and one that is a pseudo device so we'll go into slash dev and on my system I have a total of four hard drives and that's listed here SDA is my first one SD b SD c and SD d those are actual physical devices and then the numbers are all the partitions so SDA has three partitions and so on so that that points to the actual device itself and the B here that means block device now as far as a pseudo device there's a thing called you random and so /dev /u random is a pseudo device that just gives you endless amounts of random bytes so if we use can't slash dev slash your random you can see that it just spams analyst amounts of randomness now in my computer I don't have a physical random you know byte generator so this is simply a pseudo device that that Linux sees as a real device next folder is /e TC or some people call it slash Etsy this is going to be the place that you're gonna find system and program configuration files this is true of both user installed software as well like say you do app to install Redis it's smart money it's gonna be that you're gonna find the configuration file in slash etc' so you can see here I have I have a Redis folder here look what's in there and I have a Redis dot-com file and that's in /et c / Redis and that's true for just about everything you could see that there's configurations 4x11 that's your window manager those configurations like I have TeamViewer just configurations for that and this is gonna be the place for all the configuration files for the system next is slash home and when a new users create on the Linux they will get a home directory unless the user was created as a as a non you know as a user doesn't get a home directory so we can go into slash home and in my case there's just one folder called Brian and that's gonna be the the home directory and these are only for non-root users that's that's an important thing root has its own directory which we'll cover in a second and inside each person's home directory can just be whatever they want to put in there as well as any configuration that applies to that particularly user in their home directory the next three folders is gonna be slash Lib /lib 32 and slash 64 this is gonna be the library files are used by the system and that's gonna include things like shared object files as well as other files most of the files will just be found in slash live but if there are 32-bit variants and 64-bit variants of different library files then they can be placed in either of those two folders next folder is the Lost and Found folder and that's that's mostly used by fsck to help recover fragments of files that may have been damaged due to some file system corruption you probably won't ever need to interact with this folder the next is the slash media folder some distros have a media folder like this where if you were to plug in say like an external USB key then the system may mount that USB key to slash media slash and then some unique identifiers and then let you access it from the system you could also mount things yourself here but the better place to do that's going to be the /mnt folder which we're going to cover next so for the /mnt folder also called slash mount that's gonna be the place you're gonna mount various file systems whether that's local disks or network disks or so on summary before I said Linux has no concept of like C Drive D Drive e Drive and so on well this is where a slash mount comes in so if you were to buy a new hard drive say a two terabyte you put into your computer on Windows it might offer that up as the e Drive or the F Drive whereas in Linux you have to go into slash mount create a folder call it you know photos and then you can mount that drive on to that folder so you would say mount my new hard drive on /mnt slash you know pictures from there /mnt slash pictures is in effect your II drive so let's just examine a couple mounted drives so if I go into /mnt and look what's in here I have three folders sent critten extra and these are places where I've mounted actual drives to it and you can use the mount command I'm gonna grab this SD so I can see the actual disks and you can see where these are mounted so like I have slash dev slash SDC one and I have that mounted on slash mounts a secret and then I have slash dev slash s DD one on slash mount slash extra in effect SDC one would be like the e Drive and then SD d one would be like the F Drive it's just two external disks that I have in my computer that I've mounted onto a folder so I can use them next is the /opt folder you can use that for really whatever you want for very software I like to put software that I develop into there that I might be running on like a cloud server but there's no there's no special pattern on what you have to use that folder for on my machine there's currently nothing in it next is the /proc folder and this is a very important folder and this is a virtual file system for system resources and information about processes along with a couple other things so if we go into /proc do LS dash L we can see a number of different different things here and what's in this folder is first is a lot of folders and what this is is it's a folder for every process on the system so this is gonna be the actual process IDs here on the right but there's other files in here as well there's also crypto CPU info consoles IO mem there's mem stat miscellaneous modules and these are all things that you can interact so some of these are read-only but some of these you can actually put data into so like for instance I'll do cat Proc up time and you can see that it gives me different values as I go you know this is a this is a virtual file that's pointing to the uptime of the system remember I say there's a folder for every process so like number PID one is gonna be system D so if I go to /proc slash one then I get a whole list of files that are specific to that process and memories are all virtual so if I want to see things like limits I want to understand what the limits are for this particular process I can look at that file and it gives me all the limits for that one process the next folder is slash route so this is the root user home directory you know route gets its own directory like it wouldn't be in slash home slash route it's just going to be in slash route and this is not to be confused with the root directory which is just slash it's the thing that has all these folders in it so slash root is the home directory for the root user next folder is spen this is kind of like bin except this is going to be executables that are mostly for systems administrators so if I go into espen have a look at all these we can see things like creating file systems we can see things like creating you know for mounting stuff looking at IP tables for firewalls looking at block devices and tons about of different things but these are mostly for administrators who are doing some work to the system and not so much for just the normal user next is the slash TMP folder or temp folder and this folder is going to be a place to write temporary files and when I say temporary I really do mean temporary once the system reboots it's gonna just wipe out that whole folder so never save any work that you want to keep into that folder but if you want to just put some files in there that are temporary then you know go ahead and do that next is the slash user folder and the slash user folder is almost like a mini Linux file system if we go into the slash user folder we see a lot of things that we see in the root directory like bin et Cie Lib s-pen source and so on but these are all things that are geared more towards the actual user program and user operations whereas the other stuff is more like system level it's also worth pointing out that specifically with respect to the bin folder which contains executables executables that you put into there by default will override those that are in like slash bin so if you had an executable called LS in slash user slash bin it's gonna run that instead of slash bin however if you have no LS for instance in that folder it will fall back to slash bin and that that's all based on your path by default the path is set to use slash bin as a last resort well that's for to look as the var folder and that's gonna be just for variable files that's just a mishmash of whatever you want to put in here and you can see there's things like its cache folder or backups folder but there's two things of interest here one is the log file so in that folder there's basically all the system logs that you might have for for various purposes like your syslog or your xorg log and so on then we're done that's the Linux file system I know some of it was kind of confusing hopefully everybody has a pretty good grasp on what each of these folders on Linux is for and as always if you have any questions you know put them in the comments below or come chat with me on discord other than that I will see you on the next video
Info
Channel: Engineer Man
Views: 130,736
Rating: 4.9631338 out of 5
Keywords: linux, linux file system, engineer man
Id: UFIoRLqhFpo
Channel Id: undefined
Length: 12min 29sec (749 seconds)
Published: Sun Jan 06 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.