Linux Directories Explained - including /etc /home /var /proc /usr

If you are new to Linux then the directory structure can be confusing, but within a few minutes you can understand the essentials. Get over 90% off our Linux Power User Bundle: andauth.co/LinuxPowerUserBund...
Introduction to Android app development: www.dgitacademy.com
Let Me Explain T-shirt: teespring.com/gary-explains-l...
Twitter: / garyexplains
Instagram: / garyexplains
#garyexplains

Пікірлер: 84

  • @ruixue6955
    @ruixue69553 жыл бұрын

    6:12 8:11 /etc configuration files 10:38 /var - 10:43 log files, queues for emails etc. 11:31 /tmp

  • @knack6157

    @knack6157

    2 жыл бұрын

    Thank you

  • @lawrencedoliveiro9104
    @lawrencedoliveiro91044 жыл бұрын

    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.

  • @hansdampf2284

    @hansdampf2284

    2 жыл бұрын

    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.

  • @lawrencedoliveiro9104
    @lawrencedoliveiro91044 жыл бұрын

    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).

  • @lawrencedoliveiro9104
    @lawrencedoliveiro91044 жыл бұрын

    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.

  • @artmcteagle
    @artmcteagle4 жыл бұрын

    ' /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!

  • @akshayshetye8718
    @akshayshetye87184 жыл бұрын

    Dear Gary, you should seriously consider starting linux course on this channel. I learned AWK and file system in No time! Thanks to you.

  • @AAKASHDHOLAKIAlambo
    @AAKASHDHOLAKIAlambo4 жыл бұрын

    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!

  • @lawrencedoliveiro9104
    @lawrencedoliveiro91044 жыл бұрын

    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.

  • @sleeping8451
    @sleeping84514 жыл бұрын

    Love when you make videos that includes Linux very informing 👍

  • @philipthatcher2068
    @philipthatcher20684 жыл бұрын

    An excellent overview. Very helpful.

  • @megabassX
    @megabassX4 жыл бұрын

    I love the information's and speed in which they are being presented

  • @1MarkKeller
    @1MarkKeller4 жыл бұрын

    *GARY!!!* *Good Afternoon Professor!* *Good Afternoon Fellow Classmates!*

  • @GaryExplains

    @GaryExplains

    4 жыл бұрын

    MARK!!!

  • @DanielPeraalta
    @DanielPeraalta4 жыл бұрын

    really useful explanation, thanks a lot!

  • @piiumlkj6497
    @piiumlkj64974 жыл бұрын

    Great explanation

  • @pallavprabhakar
    @pallavprabhakar4 жыл бұрын

    Thanks a lot.. lot of things got cleared for me

  • @CommodoreFan64
    @CommodoreFan644 жыл бұрын

    Awesome info!!

  • @johng7rwf419
    @johng7rwf4194 жыл бұрын

    Thank you, that video took me back 35+ years!

  • @danmomanyi5692
    @danmomanyi56924 жыл бұрын

    hey thanks for the tonnes of information,,

  • @donporter8432
    @donporter84324 жыл бұрын

    Well presented

  • @beeblackblue
    @beeblackblue4 жыл бұрын

    this is good topic btw thx for covering this beginner guide to linux

  • @KeepEvery1Guessing
    @KeepEvery1Guessing4 жыл бұрын

    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".

  • @skolarii
    @skolarii4 жыл бұрын

    Awesome video gary.. should've covered opt also

  • @gogogogogogogogogogog9
    @gogogogogogogogogogog94 жыл бұрын

    wow nice as usual

  • @Chura-jz3mt
    @Chura-jz3mt3 жыл бұрын

    Great music in background😉

  • @kingoftennis94
    @kingoftennis944 жыл бұрын

    This was awesome

  • @jagardina
    @jagardina4 жыл бұрын

    I was the SA for a department back at bellcore (bell labs) named Bin. We used to call him user Bin. Unix reasons.

  • @lawrencedoliveiro9104
    @lawrencedoliveiro91044 жыл бұрын

    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.

  • @fuseteam

    @fuseteam

    4 жыл бұрын

    eh? they are dropping support for it?

  • @harrytrueman4216
    @harrytrueman42163 жыл бұрын

    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?

  • @smthsmth111
    @smthsmth1114 жыл бұрын

    Useful 👍

  • @fuseteam
    @fuseteam4 жыл бұрын

    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

  • @1toneboy
    @1toneboy4 жыл бұрын

    Thought this video would be a repetition of what has already been said, but it was still worth watching

  • @hassanzahin7852
    @hassanzahin78524 жыл бұрын

    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.

  • @TheGosteen
    @TheGosteen4 жыл бұрын

    Subscribed!

  • @meliodas.1108
    @meliodas.11084 жыл бұрын

    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?

  • @Graham1904
    @Graham19044 жыл бұрын

    Great video. Why are some of the directory files in a different colour?

  • @anirbanc88
    @anirbanc882 жыл бұрын

    what is the setting to show directory ascii banner as you do cd???, its very cool

  • @paulsmith8289
    @paulsmith82894 жыл бұрын

    /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.

  • @lawrencedoliveiro9104

    @lawrencedoliveiro9104

    4 жыл бұрын

    It’s a real directory. It’s the filesystem that’s “virtual”.

  • @lawrencedoliveiro9104
    @lawrencedoliveiro91044 жыл бұрын

    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.

  • @lawrencedoliveiro9104

    @lawrencedoliveiro9104

    4 жыл бұрын

    6:30 Ah, you are explaining it, good.

  • @RobinCawthorne
    @RobinCawthorne4 жыл бұрын

    What about dev and sys?

  • @alanscallycooper5334
    @alanscallycooper53344 жыл бұрын

    How do you display the current folder name in that large font at the top of your pages?

  • @GaryExplains

    @GaryExplains

    4 жыл бұрын

    I used the command: figlet `pwd`

  • @thierrybasanisi3424

    @thierrybasanisi3424

    4 жыл бұрын

    I think Gary has also created an alias to clear the screen and print the current directory, something like alias cls='clear; figlet `pwd`'

  • @alanscallycooper5334

    @alanscallycooper5334

    4 жыл бұрын

    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'

  • @hansdampf2284
    @hansdampf22842 жыл бұрын

    0:58 some say that because many people in computer science have never seen a tree in real life

  • @voiceoftreason1760
    @voiceoftreason17604 жыл бұрын

    Is it possible to copy files with Nautilus graphical file manager as the root user?

  • @WP7Nettwerk
    @WP7Nettwerk4 жыл бұрын

    I like idea of usr - universal system resources.

  • @thaernejem7317
    @thaernejem73174 жыл бұрын

    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

  • @thaernejem7317

    @thaernejem7317

    4 жыл бұрын

    A. Hutsona thanks a lot for your answer

  • @TechnicolorMammoth

    @TechnicolorMammoth

    4 жыл бұрын

    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.

  • @TechnicolorMammoth

    @TechnicolorMammoth

    4 жыл бұрын

    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"

  • @thaernejem7317

    @thaernejem7317

    4 жыл бұрын

    Thanks a million mate, will have a look at the website and see the reviews if any. Much appreciated

  • @thaernejem7317

    @thaernejem7317

    4 жыл бұрын

    Technicolor thank you for your reply, I may consider Knoppix, cheers mate

  • @JanBruunAndersen
    @JanBruunAndersen4 жыл бұрын

    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.

  • @ruixue6955
    @ruixue69553 жыл бұрын

    1:31 /usr

  • @marcusk7855
    @marcusk78554 жыл бұрын

    I feel like the poor old swap partition should have gotten a mention. You cant even see it so nobody even thinks about it.

  • @send2gl
    @send2gl4 жыл бұрын

    So /proc has four characters....

  • @GaryExplains

    @GaryExplains

    4 жыл бұрын

    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.

  • @MichaelReineke
    @MichaelReineke3 жыл бұрын

    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.

  • @survivor303
    @survivor3034 жыл бұрын

    who say it that the tree needed to be upsidedown?

  • @skf957
    @skf9574 жыл бұрын

    Music - nil point.

  • @GarySims

    @GarySims

    4 жыл бұрын

    Comment - nil point.

  • @skf957

    @skf957

    4 жыл бұрын

    @@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!

  • @dutchdykefinger
    @dutchdykefinger4 жыл бұрын

    anyone can''t be arsed typing sudo all the time and just do a "sudo -i" defeating the whole purpose? ;)

  • @mohammedmohammed519
    @mohammedmohammed5194 жыл бұрын

    Music in the background is super annoying.

  • @xavierrodriguez1601
    @xavierrodriguez16014 жыл бұрын

    Whaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat

  • @djvar94
    @djvar944 жыл бұрын

    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

  • @Dray7777
    @Dray77773 жыл бұрын

    please open a lbry channel. Better than You Tube. Decentralised, no adds and crypto tips

  • @GaryExplains

    @GaryExplains

    3 жыл бұрын

    And if there are no ads, how do creators earn an income?

  • @Dray7777

    @Dray7777

    3 жыл бұрын

    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

    @GaryExplains

    3 жыл бұрын

    @@Dray7777 I see. Unfortunately my local supermarket does not accept crypto currency only regular money.

  • @Dray7777

    @Dray7777

    3 жыл бұрын

    @@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

  • @GaryExplains

    @GaryExplains

    3 жыл бұрын

    @@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?