3:27 I do that on my own machines as well-keep the OS on a separate partition from /home. I also allocate at least one other partition the same size as the OS one, in case I want to distro-hop later. When I reboot into the new OS, it can mount the same /home as the existing one, and so I have all my user files immediately available, without having to copy them back and forth.
Also you have Firefox and such already configured since this is in your home directory. When I used ubuntu and system upgrade were still quite expected to break your system, I just backed up my apt selection of packages, reinstalled Ubuntus new version and then reinstalled my selection.
10:40 /var is (mostly) for writable files maintained by system processes. For example, log files in /var/log, important data (e.g. MySQL and PostgresQL databases) in /var/lib, less important data (it wouldn’t be the end of the world if this was lost) in /var/cache, various queues (e.g. print jobs, outgoing mail) in /var/spool. /var/tmp is a bit of an exception to this, in that your own code can write to here as well; it’s intended for temporary files that you would like to have a slightly longer lifetime than if they were in /tmp. Also users’ mail inboxes may sometimes be found in /var/mail, unless you are using the maildir mailbox format (which I prefer).
12:04 Note the usual convention is to use standard library routines for creating temporary files/directories. These are correctly coded to generate unique names and avoid the chance of name collisions. Also they respect the convention where if the TMPDIR environment variable is defined when your program is invoked, then that is meant to be used as the location for placing the temporary files, in place of /tmp.
' /root ' should not be confused with '/ ' directory. /root is the root user's home directory (within / ) and not the root directory, a lot of newbies get confused by this, at least one did ;) Good video, very well explained!
You mentioned the /proc filesystem, the other (similar) important one is usually to be found mounted at /sys, and this contains all the details about your hardware that are known to the kernel. Both of these are not real filesystems, they are entirely figments of the kernel. When you open a file here and read from it, you are getting information direct from the horse’s mouth, as it were. And some files are also writable, and can be used to reconfigure the kernel on the fly.
6:40 Actually that was only important back when disks were a lot smaller. These days the idea of putting /usr on a separate partition is actually considered an anachronism, and distros are dropping support for it. Which means the /«dir»-versus-/usr/«dir» distinction is becoming an anachronism, too.
Actually home directories were originally directly in /usr . Mine was /usr/waf , I had buddies with /usr/eaw and /usr/leb , for instance. I always thought that the users sub-directory was a Digital (nee DEC, from ultrix) thing, though it could have been a system V thing. At least the earlier BSDs didn't, IIRC, have it. The trouble is that /usr contained a mix of things that you got from install media, or at least didn't require frequent backups, user's personal files, which needed more frequent backups. /home was a much better solution. And, similarly, /var was stuff that varied from system to system though installed on identical hardware from the same installation media, not because the files varied in length. Lots of files varied in length. A distinction that impacted, again, how often they needed backups (and maybe how deep a set of backups were kept). And the originators did like leaving out letters, not just in directory names, but, for example the system call for creating a file was "creat".
Can you do a partition video, basically if you are installing a flavour of Linux, what size would you recommend the slash folders to be and on what drives if possible?
5:30 Executables will be found in both /bin and /usr/bin. For example, bash is usually found at /bin/bash, not /usr/bin/bash. There are also libraries in /lib versus /usr/lib, and more executables in /sbin versus /usr/sbin. Are you going to explain why in the next few minutes? If not, I will.
As a Windows user since Windows 95, I find this folder structure to be quite bizarre, but you did a great job of explaining it. I find it extremely strange that the physical drive isn't at the root of the tree. Some other digging around seems to suggest that extra drives can appear anywhere, which is also weird.
I'm glad my video was useful. The thing to remember is should the file system be drive based, i.e. the physical drives determine the structure and layout, or should the drives just be the storage for the structure and layout? Unix and therefore Linux say the latter.
Hey gary, Can you make a video about adding os in the grub menu? I have Opensuse leap on a hard drive and Pheonix os (android) on another hard drive. Now everytime I want to boot on andriod, I have to go to the boot menu and manually select the hard drive. But if I can add Phoenix os in grub, it will be alot easier to switch os. Please make a video about it.
/proc is a 'virtual' directory - it's just dynamic information presented in files and organised into a directory structure. They look like files and can be read like normal but they don't actually exist but it can be useful at times.
Thanks guys, yes I had to install ‘figlet’ then I also found app ‘toilet’ so I now have 2 aliases: alias cl='clear;pwd | figlet;sleep 2' alias cls='clear;pwd | toilet -f term -F border --gay;sleep 2'
hmmm now i wonder if all applications we install ends up in the /usr directory, like can we mount /usr to different partition to let it survive a reinstall :p hmm then again config goes into /etc
Hey is there a way I can read the content in my RAM , I don't mean the name of the process ... The actual data that's running in the main memory ..is there a way to see that?
I think you are a bit off, Gary, when you insists that all the sbin directories are for superuser stuff. Unless I am mistaken the sbin stuff is for statically linked binaries. For those who wonders what that means, know that when *nix is running normally, most programs will load library functions from /usr/lib/, e.g. that /usr/lib/bluetooth thing (except it will most likely be /usr/lib/bluetooth.so) with ".so" meaning that the file is a shared object = a library. But when the system is not running normally, e.g. during boot when /usr might not be ready and mounted, or if the /usr file system has been corrupted, then it will be a very bad thing if programs like sh, fsck, mount, was dependent on library files in /usr/lib. So instead of being dynamically linked, special copies of sh, fsck, and mount that are statically linked (meaning that all the library code is linked into the program and not kept somewhere else) is put in /sbin. Those programs will be bigger in size that their counterparts in /bin (or /usr/bin) because library code is part of the program file, but since there are so few in /sbin, it does not matter.
Hi Garry, a question out of the subject: I have a 8GB laptop and in need to install 3 virtual machines which will use 4,2,1 gb of ram. What linux distro uses the smallest amount of ram and i can install VirtualBox? Thank you
I've personally had the best luck with Knoppix on low ram systems. Make sure to actually install it, since it runs from RAM when it's a live CD and that's basically its thing. It's made to be very stable and not updated too often to make sure it works out of the box on recovery and live CD usage, so don't expect the most bleeding edge versions of software. But, all in all, this is just my experience. Knoppix is "old", since it started the whole Live CD thing. Puppy Linux, Sparky Linux and Peppermint are newer and designed to be installed on lightweight systems. Heck any distro that runs from the CLI or xfce or LXDE GUIs is probably going to run light. Check distrowatch.com and go through the distros. They'll say "lightweight" in their description if they are just that.
Booted up my "ancient machine" that I have Knoppix 7.2 on and it has VB 4.2.10. While this can work, I'd say for you that you should just go with a fresh distro like the others I mentioned. Me having Knoppix is more a "I love Linux so much I found a way to get it on all my computers one way or another even if it meant it's an old outdated version of the kernel and packages...at least it works"
Wait, people call usr "U S R"? I thought EVERYBODY called it USER? I heard somewhere that Swedish people call USA "Yousa" instead of "You Ess Ae". Maybe just Swedish people call USR that.
@@GarySims Hi Gary, I really like your content, but last night, through headphones, that background "music" was just irritating. At first I thought the headphones were picking interference up. It was irritating enough for me to leave an irritated comment and stop watching. I like your reply to my original (if too brief) comment!
I would like to say one thing. When it comes to these technical videos or any other thing for the matter I find the background silly copyright free music (but that would apply to any kind of music, even copyrighted one) so ridiculously annoying and distracting. It's already hard enough having to follow what you're saying so fast but also to get the concepts of something that I might not be so familiar with or perhaps I know but not that much in depth. So please when you make a video just talk. Don't put any silly music in the background because that's just plain distracting. Thank you
You earn by -Getting tipped in crypto currency OR - Put a price on certain videos (will be paid in crypto). You set the price. So can be 0.001 cents all the way to something like 2000 pounds. Then when people want to watch your vid, they need to pay you
@@GaryExplains Then sell the crypto for cash the moment they enter your wallet. They will accept the money you sell it for. Many online companies accept crypto as a form of payment anyways
@@Dray7777 Doesn't seem that is an advantage, just more hassles. Doesn't sound like there's anything that would make me want to change. What is my incentive?
6:12
8:11 /etc configuration files
10:38 /var - 10:43 log files, queues for emails etc.
11:31 /tmp
Thank you
3:27 I do that on my own machines as well-keep the OS on a separate partition from /home. I also allocate at least one other partition the same size as the OS one, in case I want to distro-hop later. When I reboot into the new OS, it can mount the same /home as the existing one, and so I have all my user files immediately available, without having to copy them back and forth.
Also you have Firefox and such already configured since this is in your home directory.
When I used ubuntu and system upgrade were still quite expected to break your system, I just backed up my apt selection of packages, reinstalled Ubuntus new version and then reinstalled my selection.
10:40 /var is (mostly) for writable files maintained by system processes. For example, log files in /var/log, important data (e.g. MySQL and PostgresQL databases) in /var/lib, less important data (it wouldn’t be the end of the world if this was lost) in /var/cache, various queues (e.g. print jobs, outgoing mail) in /var/spool. /var/tmp is a bit of an exception to this, in that your own code can write to here as well; it’s intended for temporary files that you would like to have a slightly longer lifetime than if they were in /tmp. Also users’ mail inboxes may sometimes be found in /var/mail, unless you are using the maildir mailbox format (which I prefer).
12:04 Note the usual convention is to use standard library routines for creating temporary files/directories. These are correctly coded to generate unique names and avoid the chance of name collisions. Also they respect the convention where if the TMPDIR environment variable is defined when your program is invoked, then that is meant to be used as the location for placing the temporary files, in place of /tmp.
' /root ' should not be confused with '/ ' directory.
/root is the root user's home directory (within / ) and not the root directory, a lot of newbies get confused by this, at least one did ;)
Good video, very well explained!
You mentioned the /proc filesystem, the other (similar) important one is usually to be found mounted at /sys, and this contains all the details about your hardware that are known to the kernel.
Both of these are not real filesystems, they are entirely figments of the kernel. When you open a file here and read from it, you are getting information direct from the horse’s mouth, as it were. And some files are also writable, and can be used to reconfigure the kernel on the fly.
Dear Gary, you should seriously consider starting linux course on this channel.
I learned AWK and file system in No time! Thanks to you.
6:40 Actually that was only important back when disks were a lot smaller. These days the idea of putting /usr on a separate partition is actually considered an anachronism, and distros are dropping support for it.
Which means the /«dir»-versus-/usr/«dir» distinction is becoming an anachronism, too.
eh? they are dropping support for it?
Thank you so much! This was giving me issues last week! I put it on hold till I could figure it out, I wont have to do that anymore!
*GARY!!!*
*Good Afternoon Professor!*
*Good Afternoon Fellow Classmates!*
MARK!!!
An excellent overview. Very helpful.
I love the information's and speed in which they are being presented
Actually home directories were originally directly in /usr . Mine was /usr/waf , I had buddies with /usr/eaw and /usr/leb , for instance. I always thought that the users sub-directory was a Digital (nee DEC, from ultrix) thing, though it could have been a system V thing. At least the earlier BSDs didn't, IIRC, have it. The trouble is that /usr contained a mix of things that you got from install media, or at least didn't require frequent backups, user's personal files, which needed more frequent backups. /home was a much better solution. And, similarly, /var was stuff that varied from system to system though installed on identical hardware from the same installation media, not because the files varied in length. Lots of files varied in length. A distinction that impacted, again, how often they needed backups (and maybe how deep a set of backups were kept). And the originators did like leaving out letters, not just in directory names, but, for example the system call for creating a file was "creat".
Love when you make videos that includes Linux very informing 👍
Great explanation
Can you do a partition video, basically if you are installing a flavour of Linux, what size would you recommend the slash folders to be and on what drives if possible?
I was the SA for a department back at bellcore (bell labs) named Bin. We used to call him user Bin. Unix reasons.
really useful explanation, thanks a lot!
5:30 Executables will be found in both /bin and /usr/bin. For example, bash is usually found at /bin/bash, not /usr/bin/bash. There are also libraries in /lib versus /usr/lib, and more executables in /sbin versus /usr/sbin. Are you going to explain why in the next few minutes? If not, I will.
6:30 Ah, you are explaining it, good.
Great music in background😉
this is good topic btw thx for covering this beginner guide to linux
Thank you, that video took me back 35+ years!
Awesome video gary.. should've covered opt also
Well presented
Thought this video would be a repetition of what has already been said, but it was still worth watching
As a Windows user since Windows 95, I find this folder structure to be quite bizarre, but you did a great job of explaining it. I find it extremely strange that the physical drive isn't at the root of the tree. Some other digging around seems to suggest that extra drives can appear anywhere, which is also weird.
I'm glad my video was useful. The thing to remember is should the file system be drive based, i.e. the physical drives determine the structure and layout, or should the drives just be the storage for the structure and layout? Unix and therefore Linux say the latter.
Thanks a lot.. lot of things got cleared for me
wow nice as usual
Awesome info!!
Hey gary, Can you make a video about adding os in the grub menu? I have Opensuse leap on a hard drive and Pheonix os (android) on another hard drive. Now everytime I want to boot on andriod, I have to go to the boot menu and manually select the hard drive. But if I can add Phoenix os in grub, it will be alot easier to switch os. Please make a video about it.
hey thanks for the tonnes of information,,
what is the setting to show directory ascii banner as you do cd???, its very cool
/proc is a 'virtual' directory - it's just dynamic information presented in files and organised into a directory structure. They look like files and can be read like normal but they don't actually exist but it can be useful at times.
It’s a real directory. It’s the filesystem that’s “virtual”.
What about dev and sys?
How do you display the current folder name in that large font at the top of your pages?
I used the command: figlet `pwd`
I think Gary has also created an alias to clear the screen and print the current directory, something like
alias cls='clear; figlet `pwd`'
Thanks guys, yes I had to install ‘figlet’ then I also found app ‘toilet’ so I now have 2 aliases:
alias cl='clear;pwd | figlet;sleep 2'
alias cls='clear;pwd | toilet -f term -F border --gay;sleep 2'
hmmm now i wonder if all applications we install ends up in the /usr directory, like can we mount /usr to different partition to let it survive a reinstall :p
hmm then again config goes into /etc
This was awesome
I like idea of usr - universal system resources.
Great video. Why are some of the directory files in a different colour?
Is it possible to copy files with Nautilus graphical file manager as the root user?
Useful 👍
Hey is there a way I can read the content in my RAM , I don't mean the name of the process ... The actual data that's running in the main memory ..is there a way to see that?
1:31 /usr
0:58 some say that because many people in computer science have never seen a tree in real life
Subscribed!
I think you are a bit off, Gary, when you insists that all the sbin directories are for superuser stuff. Unless I am mistaken the sbin stuff is for statically linked binaries.
For those who wonders what that means, know that when *nix is running normally, most programs will load library functions from /usr/lib/, e.g. that /usr/lib/bluetooth thing (except it will most likely be /usr/lib/bluetooth.so) with ".so" meaning that the file is a shared object = a library.
But when the system is not running normally, e.g. during boot when /usr might not be ready and mounted, or if the /usr file system has been corrupted, then it will be a very bad thing if programs like sh, fsck, mount, was dependent on library files in /usr/lib. So instead of being dynamically linked, special copies of sh, fsck, and mount that are statically linked (meaning that all the library code is linked into the program and not kept somewhere else) is put in /sbin. Those programs will be bigger in size that their counterparts in /bin (or /usr/bin) because library code is part of the program file, but since there are so few in /sbin, it does not matter.
Hi Garry, a question out of the subject: I have a 8GB laptop and in need to install 3 virtual machines which will use 4,2,1 gb of ram. What linux distro uses the smallest amount of ram and i can install VirtualBox? Thank you
A. Hutsona thanks a lot for your answer
I've personally had the best luck with Knoppix on low ram systems. Make sure to actually install it, since it runs from RAM when it's a live CD and that's basically its thing. It's made to be very stable and not updated too often to make sure it works out of the box on recovery and live CD usage, so don't expect the most bleeding edge versions of software. But, all in all, this is just my experience. Knoppix is "old", since it started the whole Live CD thing. Puppy Linux, Sparky Linux and Peppermint are newer and designed to be installed on lightweight systems. Heck any distro that runs from the CLI or xfce or LXDE GUIs is probably going to run light. Check distrowatch.com and go through the distros. They'll say "lightweight" in their description if they are just that.
Booted up my "ancient machine" that I have Knoppix 7.2 on and it has VB 4.2.10. While this can work, I'd say for you that you should just go with a fresh distro like the others I mentioned. Me having Knoppix is more a "I love Linux so much I found a way to get it on all my computers one way or another even if it meant it's an old outdated version of the kernel and packages...at least it works"
Thanks a million mate, will have a look at the website and see the reviews if any. Much appreciated
Technicolor thank you for your reply, I may consider Knoppix, cheers mate
Wait, people call usr "U S R"? I thought EVERYBODY called it USER?
I heard somewhere that Swedish people call USA "Yousa" instead of "You Ess Ae". Maybe just Swedish people call USR that.
So /proc has four characters....
Indeed, but it wasn't part of the original Unix when all the other directory names were invented. It was added to UNIX 8 in the mid 1980s.
I feel like the poor old swap partition should have gotten a mention. You cant even see it so nobody even thinks about it.
who say it that the tree needed to be upsidedown?
anyone can''t be arsed typing sudo all the time and just do a "sudo -i" defeating the whole purpose? ;)
Music - nil point.
Comment - nil point.
@@GarySims Hi Gary, I really like your content, but last night, through headphones, that background "music" was just irritating. At first I thought the headphones were picking interference up. It was irritating enough for me to leave an irritated comment and stop watching. I like your reply to my original (if too brief) comment!
I would like to say one thing. When it comes to these technical videos or any other thing for the matter I find the background silly copyright free music (but that would apply to any kind of music, even copyrighted one) so ridiculously annoying and distracting. It's already hard enough having to follow what you're saying so fast but also to get the concepts of something that I might not be so familiar with or perhaps I know but not that much in depth. So please when you make a video just talk. Don't put any silly music in the background because that's just plain distracting. Thank you
Music in the background is super annoying.
Whaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat
please open a lbry channel. Better than You Tube. Decentralised, no adds and crypto tips
And if there are no ads, how do creators earn an income?
You earn by
-Getting tipped in crypto currency
OR
- Put a price on certain videos (will be paid in crypto). You set the price. So can be 0.001 cents all the way to something like 2000 pounds. Then when people want to watch your vid, they need to pay you
@@Dray7777 I see. Unfortunately my local supermarket does not accept crypto currency only regular money.
@@GaryExplains Then sell the crypto for cash the moment they enter your wallet. They will accept the money you sell it for. Many online companies accept crypto as a form of payment anyways
@@Dray7777 Doesn't seem that is an advantage, just more hassles. Doesn't sound like there's anything that would make me want to change. What is my incentive?