"Where's my C:\ Drive?" | The Linux File System Explained!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I agree, he's a great guy

👍︎︎ 1 👤︎︎ u/cgpipeliner 📅︎︎ Nov 18 2020 🗫︎ replies
Captions
before i was a full-time linux user i was very familiar with the dos file system hierarchy if you're coming from windows you probably know how it works i mean you have a drive that drive is assigned a letter and then things get installed into directories on that drive so your operating system was probably installed to see colon slash windows and programs are generally installed to see colon slash program files there might be some other fancy setup you have but generally that's how it shakes out in the end on linux things are a might bit different and truthfully the linux file system is laid out in a way that was so foreign to me at first that my first attempt at using linux as my daily driver on fedora was actually a miserable failure but i kept at it and i found resources that helped me grok uh the the differences between linux and windows and how it uses its directories in the system uh to store the programs and applications and all the other things that you might need to do on your computer so that's what i'm going to try and do with this video this is understanding the linux file system so let's take a look at the actual file system if we uh go up here to activities and on on other systems that might be a little different and we click on files we can see that it brings up our home directory right now what we actually want to do is view the uh root directory so we can click on other locations and click on computer and here you can see we are at the root directory now what is the root directory well if you can think of the root directory as the roots of a tree it's where the tree gets it gets its start basically uh so if we hit ctrl l on the keyboard we can see the path name now on windows this would be equivalent roughly equivalent to c colon slash but on linux it's just a forward slash and so this is our computer this is where all of everything exists in linux um even your other drives uh we'll get to that in a second so first up we have slash bin and slash bin is where all of the binary files uh for your computer exist now your binary files are going to be roughly equivalent to exe files these are these are basically programs on your computer if you're familiar with the linux terminal we have a lot of the applications that you would run in the terminal here we have cat if we scroll all the way down we have a tool that lets you unzip files with uh where is it zip right there and there's even an application like ssh in here and and that's the bin folder now if we go back we can actually see we have another directory called boot this directory contains everything that your computer needs to actually successfully boot into linux this is somewhat of an advanced area uh i would recommend not being in there for new users anyway uh so let's go into dev this is slash dev now we can see here that this is that there's just a bunch of files in here what are these files well this directory basically contains all of the hardware of your machine now you might be wondering how could the file system contain all the hardware well these are these are virtual representations of the hardware anytime you need to send or receive information from the hardware in your computer well this is where you're going to do it now none of these files are actually written to disk these are all going to be virtual files that aren't actually there but it it works as if it was a file now if you were to open this up in your terminal you'd be able to interact with some of this stuff linux has a couple of directories that are like this where it's filled with virtual files uh like if you go into disk here you can see that all of the disks in this system are actually uh shown here uh you can actually see nvme uh partition three and partition one and so on um they're all represented here you can see them by id by label uh you can see them by part label and the path through this dev directory to that device is what you'd actually use to mount the device to another path we'll talk about mounting a little bit later but suffice it to say that is another uh somewhat of an advanced area of the file system you don't you need to be there if you're a new user now etc here or etc is where you might actually start taking interest this is where your applications store much of their configuration data on a system-wide level and we'll talk about where a user-defined stuff goes later but in here you're going to find a couple of interesting things the first the first thing that i find most interesting here is the file system table uh and you know this looks like a bunch of gibberish if you're not familiar it might be somewhat intimidating but this is uh how your computer knows what partitions to set up and where to put them another interesting file here is hosts you can see that uh if we have popos dot local domain and if i were to type this into my web browser i it would actually be redirected back to this machine but i could do something like uh 1921681.2 which is the ip address of my home server and then i could type in something like cloud.heavy cloud.heavyelement.io and then if i were to save this which i can't save it now because i don't have uh root privileges and then i were to go over to my web browser my web browser would actually look at this file and say ah i should actually go to this ip address rather than looking up a dns request and for your local machine you can map any domain name to any ip address you want using the host file so that's an interesting thing you can't save it because you don't have permission now on this demo machine i'm actually running pop os and you can see here apt on ubuntu on ubuntu derivatives on debian derivatives apt is going to be your uh your package manager then you can actually come in here and you'll be able to uh edit these files here to just change where your uh software is coming from you can add new software to it it's pretty cool and this directory has a ton of other configuration data for the apps and services you have running on your machine next up we have games this is a directory that i added here yeah you're probably not going to have that next up we have home you can see here that we have a couple of different users here so you can see i'm logged in as g bryant i have a little home icon there i'm actually not able to access uh my cousin or abby's files here if i double click on this you can see that this is my home directory and you know there's like you know downloads and documents desktop public templates videos music pictures all that kind of stuff it looks rather straightforward it looks pretty similar to what you would find on windows right but the difference is going to be when you hit control h and you can actually see that there's config local mozilla wine var steam ssh these are all going to be uh where your local configuration data for your applications is going to be stored so this is your this is a per user directory it's your home directories i don't want to go too deep into the home directory because there's a lot that we could talk about here so i'll probably end up saving that for another video let me know what you think about that idea next up we have lib lib32 lib64 and libx32 all of these directories are going to be libraries that are shared between applications you have installed on the machine not a whole lot to talk about in these directories basically you never have to do anything with these as your package manager will actually uh handle all of that for you so let's move on lost and found can't you don't have access to that it's it's an operating system directory uh slash media is interesting because this is where uh if you were to insert like a usb mass storage device it would actually be mounted here so if i were to grab a mass storage device like this usb stick in order to plug it in you can see that there it is 64 gigabyte disk and it shows up over here as well and you might be thinking wouldn't it just be easier if it was letter drives well no one of the nice things about this is if you know how linux works and you know the name of the disk you're going to know every time when you mount that disc when you plug it in it's going to show up in that directory uh that's just one of the advantages consistency simplicity it's awesome you can actually see i have some files on here this is my grandparents let's go back to media so where media is where your system mounts uh file systems that you add to the computer slash mnt is where you can mount your own files manually now i just want to say you don't have to mount things here like if you have a disk and you want to mount it somewhere any random place on your file system you can pretty much do whatever you want like that this but mnt is a nice convenient consistent place to do it it's usually empty you don't normally store things here so slash m t is a great place to put other disks that you might want to mount now i will say that on my other computer over here i have uh my home directory on the ssd that the operating system is installed on but i also have a 10 terabyte hard drive installed in that machine and it's mounted at my home directories video folder if i go to slash home slash g bryant on that machine everything in there is on the ssd except for the files that are on in the video directory which are on a separate 10 terabyte drive i think that's really cool so traditionally if you wanted to install applications on windows you'd have to go find an exe or an msi from some random website and run through the setup wizard on linux you generally get your software from the package manager which and all of it comes from your system maintainer the people who made the operating system you're using this is infinitely more secure than the windows way of downloading random executables but what happens if the software that you want is not actually available in the systems package manager you're totally able to download software through your web browser and install it and when you do more often than not it's going to be installed in slash opt or slash opt now you can see in here i have minecraft installed so this is where you'd find all of the minecraft stuff on my other computer i have discord and library and it wouldn't be 2020 without zoom so all of those would actually get installed here and all of those i downloaded from the developers website and installed it on this machine all right let's look at slash proc now slash proc is much like slash dev in that it's going to have a virtual representation of all of the processes that are running on your system what do i mean by processes well basically all the running applications that you have right now are going to be represented here as directories and uh you have some other miscellaneous stuff here now this is another more advanced location on your file system you're not actually going to have to interact with this much unless you're going to do like programming or development on your on your system uh so yeah let's move on slash recovery that is uh a popos thing i believe that's not uh on anything i've ever seen but slash root is a directory uh for your root user the root user is basically god of a linux system it has absolute control and it has unfettered access to everywhere and everything on your machine so the root directory is basically the home directory of your root user i know it's a little confusing i know it you would think it would probably belong in home but no it lives here when it comes to linux file system slash run is a bit of a newcomer here uh this is going to be a lot of like runtime stuff like the the files that your computer needs to boot up properly when your computer is rebooted this gets all cleared out and that's another like more advanced location s-bin here is a place for system binaries so the binaries of the applications that you need as a root user are going to be in here srv is an interesting location on most systems this is going to be empty but if you have like an ftp daemon running and you allow people to connect in and upload files or download files you're going to get them saved in the srv directory also if you have web server applications running like apache or nginx they could be set up to have the web files in this directory here i'm using it as a mount point for my remote server um where i have uh much of my web development stuff in here it's kind of a mess i use srv as sort of a catch-all for uh network content sys is a directory that allows you to interact with your linux kernel this is another virtual uh file system much like dev again this is more for advanced users uh so we'll go on to the next one slash temp is another interesting directory for newbies this is where uh applications are going to write scratch and temporary data so if you uh open up in firefox a file if you go to download it and you don't click save if you just have it open it will generally save it in this directory and then when the computer reboots it's gone um and yeah like i said this gets cleared after every reboot and that's basically it for this directory next up we have slash usr which stands for unix system resource and uh this is another interesting directory when you install applications that you as a user run um in like graphical mode they tend to be installed in this place uh in any of these directories bin uh slash local slash bin if they're really if they're large games they tend to be installed in share uh so slash user slash share and also you're going to have a lot of uh your library files actually be installed into any of these directories here and the last directory on our list is slash var now slash var is where you you write files that you believe are going to grow uh continue to grow as the system uh continues to be used so you're gonna have things like uh your mail uh inbox um you're gonna have things like uh your print spool is gonna be in here cups is your principle you're gonna have things like temp there's another temp directory in there you're gonna have things like uh databases if you install a database you'll have crash logs in here in crash and you're going to have logs in here so you can actually come in here and check the logs to see if something went wrong let's see do we have anything wrong with our authorization there was a problem with the microsoft comfort mouse you're also going to have web content in here if you have like apache installed it'll be var www and that's where you'll have like your your uh default virtual host files installed you can go in there and change them as well well that's the root of the linux file system i can hear some folks asking wouldn't it just be easier if applications got installed like they are in windows and i honestly don't think that that would be the case i don't think that would be true like you want all your libraries installed in a single location if you were to open up your program files open up just any random application that's installed on windows count the number of dlls in there uh and do a search and see how many times that specific dll is replicated across your machine it's kind of crazy on linux the you know having your shared libraries all in one spot having your binaries and all in another spot having your configuration files all in another spot it allows for a more consistent and efficient system it allows applications to share resources more fluidly it might seem a little confusing but once you get to know the lay of the land it really starts to feel like home and as we all know there really is no place like slash home with that pun i think it's time to end this video thank you for watching i want to give a special shout out to my friends over on patreon who make what i do here possible if it weren't for them i wouldn't be able to do this so thank you guys i really appreciate it and if you believe in the work that i'm doing here if i've helped you in any way consider supporting the show over on patreon you can also become a channel member here on youtube uh but no matter what you do don't forget to hit that like button don't forget to subscribe to see more from me and i'll see you guys in the next one have a blessed day
Info
Channel: Gardiner Bryant
Views: 32,331
Rating: undefined out of 5
Keywords: linux, gaming, The Linux Gamer, steamos, gnu/linux, steam os, Gardiner Bryant, linux overview, satire, critique, commentary, criticism, computer, computer science, root directory, file path, linux tutorial for beginners, linux tutorial for beginners 2020, understanding linux file system structure, root, bin, etc, usr, home, linux folders, linux directory, wheres my c drive, file structure, directory structure, linux file system
Id: 1bXisjuZctU
Channel Id: undefined
Length: 17min 22sec (1042 seconds)
Published: Mon Nov 16 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.