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

  Переглядів 37,750

Gary Explains

Gary Explains

4 роки тому

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
@ruixue6955 3 роки тому
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
@lawrencedoliveiro9104 4 роки тому
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.
@artmcteagle
@artmcteagle 4 роки тому
' /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!
@lawrencedoliveiro9104
@lawrencedoliveiro9104 4 роки тому
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
@lawrencedoliveiro9104 4 роки тому
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.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 4 роки тому
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.
@akshayshetye8718
@akshayshetye8718 4 роки тому
Dear Gary, you should seriously consider starting linux course on this channel. I learned AWK and file system in No time! Thanks to you.
@1MarkKeller
@1MarkKeller 4 роки тому
*GARY!!!* *Good Afternoon Professor!* *Good Afternoon Fellow Classmates!*
@GaryExplains
@GaryExplains 4 роки тому
MARK!!!
@AAKASHDHOLAKIAlambo
@AAKASHDHOLAKIAlambo 4 роки тому
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!
@johng7rwf419
@johng7rwf419 4 роки тому
Thank you, that video took me back 35+ years!
@sleeping8451
@sleeping8451 4 роки тому
Love when you make videos that includes Linux very informing 👍
@megabassX
@megabassX 3 роки тому
I love the information's and speed in which they are being presented
@philipthatcher2068
@philipthatcher2068 4 роки тому
An excellent overview. Very helpful.
@1toneboy
@1toneboy 4 роки тому
Thought this video would be a repetition of what has already been said, but it was still worth watching
@jagardina
@jagardina 4 роки тому
I was the SA for a department back at bellcore (bell labs) named Bin. We used to call him user Bin. Unix reasons.
@beeblackblue
@beeblackblue 4 роки тому
this is good topic btw thx for covering this beginner guide to linux
@KeepEvery1Guessing
@KeepEvery1Guessing 4 роки тому
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".
@DanielPeraalta
@DanielPeraalta 4 роки тому
really useful explanation, thanks a lot!
@lawrencedoliveiro9104
@lawrencedoliveiro9104 4 роки тому
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?
@Chura-jz3mt
@Chura-jz3mt 3 роки тому
Great music in background😉
@piiumlkj6497
@piiumlkj6497 4 роки тому
Great explanation
@harrytrueman4216
@harrytrueman4216 3 роки тому
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?
@skolarii
@skolarii 3 роки тому
Awesome video gary.. should've covered opt also
@pallavprabhakar
@pallavprabhakar 4 роки тому
Thanks a lot.. lot of things got cleared for me
@donporter8432
@donporter8432 4 роки тому
Well presented
@danmomanyi5692
@danmomanyi5692 4 роки тому
hey thanks for the tonnes of information,,
@hassanzahin7852
@hassanzahin7852 4 роки тому
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.
@anirbanc88
@anirbanc88 Рік тому
what is the setting to show directory ascii banner as you do cd???, its very cool
@Graham1904
@Graham1904 4 роки тому
Great video. Why are some of the directory files in a different colour?
@CommodoreFan64
@CommodoreFan64 4 роки тому
Awesome info!!
@fuseteam
@fuseteam 4 роки тому
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
@quranqareem99
@quranqareem99 4 роки тому
wow nice as usual
@meliodas.1108
@meliodas.1108 4 роки тому
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?
@WP7Nettwerk
@WP7Nettwerk 4 роки тому
I like idea of usr - universal system resources.
@paulsmith8289
@paulsmith8289 4 роки тому
/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”.
@RobinCawthorne
@RobinCawthorne 4 роки тому
What about dev and sys?
@alanscallycooper5334
@alanscallycooper5334 4 роки тому
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'
@lawrencedoliveiro9104
@lawrencedoliveiro9104 4 роки тому
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.
@voiceoftreason1760
@voiceoftreason1760 4 роки тому
Is it possible to copy files with Nautilus graphical file manager as the root user?
@kingoftennis94
@kingoftennis94 4 роки тому
This was awesome
@smthsmth111
@smthsmth111 4 роки тому
Useful 👍
@thaernejem7317
@thaernejem7317 4 роки тому
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
@TheGosteen
@TheGosteen 4 роки тому
Subscribed!
@JanBruunAndersen
@JanBruunAndersen 4 роки тому
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.
@hansdampf2284
@hansdampf2284 2 роки тому
0:58 some say that because many people in computer science have never seen a tree in real life
@ruixue6955
@ruixue6955 3 роки тому
1:31 /usr
@marcusk7855
@marcusk7855 4 роки тому
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
@send2gl 4 роки тому
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.
@survivor303
@survivor303 4 роки тому
who say it that the tree needed to be upsidedown?
@skf957
@skf957 4 роки тому
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
@dutchdykefinger 4 роки тому
anyone can''t be arsed typing sudo all the time and just do a "sudo -i" defeating the whole purpose? ;)
@MichaelReineke
@MichaelReineke 3 роки тому
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.
@xavierrodriguez1601
@xavierrodriguez1601 4 роки тому
Whaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat
@mohammedmohammed519
@mohammedmohammed519 4 роки тому
Music in the background is super annoying.
@Dray7777
@Dray7777 3 роки тому
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?
@djvar94
@djvar94 4 роки тому
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
Windows Subsystem For Linux on Arm based Surface Pro X
9:00
Gary Explains
Переглядів 28 тис.
Linux File System/Structure Explained!
15:59
DorianDotSlash
Переглядів 3,9 млн
skibidi toilet 72 (part 1)
03:06
DaFuq!?Boom!
Переглядів 26 млн
ІГОР ГОЛОВАНЬ подав до суду на ЗЕЛЕНСЬКОГО
18:56
Спецпроекти Сергія Мамаєва
Переглядів 92 тис.
Linux File System | Complete Overview
20:58
Chris Titus Tech
Переглядів 51 тис.
Linux Crash Course - The /etc/fstab file
30:29
Learn Linux TV
Переглядів 91 тис.
EVERYONE Needs to Learn a Little Bit of AWK!
16:29
Gary Explains
Переглядів 392 тис.
Linux Crash Course - Understanding File & Directory Permissions
35:48
Learn Linux TV
Переглядів 102 тис.
Explaining File Systems: NTFS, exFAT, FAT32, ext4 & More
11:05
ExplainingComputers
Переглядів 1,3 млн
Unix vs Linux
13:59
Gary Explains
Переглядів 1,6 млн
10 Linux Terminal Commands for Beginners
13:57
Gary Explains
Переглядів 187 тис.
Is Linux an OS, a kernel or both? (Linux vs GNU/Linux)
11:07
Gary Explains
Переглядів 125 тис.
The Linux Filesystem Explained | How Each Directory is Used
14:08
Akamai Developer
Переглядів 211 тис.