Latest / CyberSecurity Summary / Learn Linux Quickly: A beginner-friendly guide to getting up and running with the world's most powerful operating system
Transcript
- 0:00Speaker 1: You know, when you pick up a technical manual, you
- 0:02Speaker 1: usually expect the dedication page to be standard boilerplate, like
- 0:06Speaker 1: to my spouse or to my kids. It's sweet, but
- 0:09Speaker 1: it's completely predictable.
- 0:11Speaker 2: It's the one page of the text you generally just
- 0:12Speaker 2: flip right past to get to the actual architecture diagrams
- 0:15Speaker 2: right exactly.
- 0:16Speaker 1: But today we are doing a deep dive into Ahmed
- 0:19Speaker 1: al Khaberi's work. Learn Linux Quickly, and his dedication genuinely
- 0:24Speaker 1: made me laugh out loud. He thanks his mom naturally,
- 0:27Speaker 1: but then he drops this note to his dad. He says,
- 0:31Speaker 1: I know you wanted me to go to medical school
- 0:33Speaker 1: to be a doctor, just like you. Sorry, pops, computer
- 0:35Speaker 1: science is the future.
- 0:37Speaker 2: I mean, it is a very confident opening m but
- 0:41Speaker 2: historically speaking, he really wasn't wrong to make that bet.
- 0:44Speaker 1: He was completely right. And that is our mission for
- 0:47Speaker 1: you today to decode the architecture of the world's most powerful,
- 0:50Speaker 1: yet largely invisible operating system, Linux, because if your perception
- 0:54Speaker 1: of Linux is still stuck on that old trope of
- 0:57Speaker 1: a lone hacker in a dark room compiling source code,
- 1:00Speaker 1: you're missing the macro scale of what this system actually is.
- 1:03Speaker 2: Oh, absolutely. The scale is staggering when you actually look
- 1:06Speaker 2: at the numbers.
- 1:07Speaker 1: Right, we are talking about the engine powering over ninety
- 1:11Speaker 1: percent of the world's supercomputers, seventy five percent of all
- 1:14Speaker 1: cloud solutions, your Android phone, government servers, Lexus and Toyota
- 1:19Speaker 1: smart cars, and I mean even some washing machines.
- 1:22Speaker 2: Yeah, you are interacting with a Linux kernel dozens of
- 1:26Speaker 2: times a day, even if a command line interface never
- 1:29Speaker 2: once flashes across your screen.
- 1:30Speaker 1: It's wild. Okay, let's unpack this before we start parsing
- 1:33Speaker 1: command syntax and all that. We need to understand where
- 1:36Speaker 1: it came from, because we need to know how it
- 1:39Speaker 1: differs from the systems we're used to, like Windows or macOS.
- 1:42Speaker 2: Well, the contrast with proprietary systems is stark, unlike Windlows
- 1:46Speaker 2: or mac which were engineered by massively funded corporate teams
- 1:50Speaker 2: under strict NDAs. Linux originated in nineteen ninety one as
- 1:54Speaker 2: a mere hobby project. Wait, a hobby project, yeah, by
- 1:57Speaker 2: Linus Torvoldz who just a computer science student in Fenmlas
- 2:00Speaker 2: and at the time he built his own Unix like
- 2:02Speaker 2: operating system and crucially it became the ultimate open source.
- 2:06Speaker 1: Project, meaning the source code, like the actual underlying logic
- 2:10Speaker 1: of the software is entirely public. Anyone can edit it.
- 2:13Speaker 1: But let me push back on this for a second.
- 2:15Speaker 2: Sure, go ahead. Wait.
- 2:16Speaker 1: If it's free and literally anyone on the internet can
- 2:19Speaker 1: edit it, how is it secure and stable enough to
- 2:21Speaker 1: run massive corporate infrastructure for like Amazon or Google?
- 2:26Speaker 2: That is a totally fair question. The open source model
- 2:29Speaker 2: relies on the idea of thousands of developers constantly reviewing
- 2:34Speaker 2: and patching the code. But to really understand how it
- 2:37Speaker 2: maintains stability for an Amazon server farm, we have to
- 2:40Speaker 2: break down the anatomy of the system. We have to
- 2:43Speaker 2: separate the concept of the operating system from the kernel.
- 2:47Speaker 1: Right, let's draw that line. Because people use those terms interchangeably,
- 2:50Speaker 1: don't they all the time?
- 2:52Speaker 2: But they are very different. The operating system is the
- 2:54Speaker 2: complete package. It includes the graphical user interface, text editors,
- 2:58Speaker 2: all the bundled apps. It manages the hardware and software overall,
- 3:02Speaker 2: but the kernel. What's fascinating here is that the kernel
- 3:05Speaker 2: is strictly the core.
- 3:06Speaker 1: The absolute center of it all exactly.
- 3:08Speaker 2: It's the part that organizes access to the CPU memory
- 3:12Speaker 2: and disc doesn't care about your web browser. It just
- 3:15Speaker 2: dictates resource allocation.
- 3:16Speaker 1: Let me try to map this out with an analogy
- 3:18Speaker 1: to see his tracks. So the operating system is a
- 3:23Speaker 1: full restaurant. You have the tables, the menus, the waiters,
- 3:26Speaker 1: the whole dining room. That's the environment we interact with.
- 3:30Speaker 2: I like where this is.
- 3:30Speaker 1: Going, But the kernel is the busy kitchen expediter. They
- 3:34Speaker 1: aren't talking to the customers at all. They actually decide
- 3:37Speaker 1: which chef gets which ingredients, which pan goes on which burner,
- 3:41Speaker 1: and exactly when a dish gets plaited.
- 3:43Speaker 2: That analogy holds up perfectly. And because this expeditor the
- 3:47Speaker 2: Linux kernel is open source, developers quickly realized they didn't
- 3:51Speaker 2: have to build just one type of restaurant around.
- 3:52Speaker 1: It, right, They could build thousands of different types of
- 3:55Speaker 1: dining rooms, all using that same amazing expeditor in the
- 3:58Speaker 1: kitchen exactly.
- 4:00Speaker 2: And that brings us to the concept of distributions or distros.
- 4:04Speaker 2: Since the kernel is free, people package it with different
- 4:07Speaker 2: apps and interfaces to create unique variations. Android is actually
- 4:11Speaker 2: a Linux distro.
- 4:12Speaker 1: Oh wow, I didn't even realize Android counted as a distro,
- 4:15Speaker 1: And Alcaberi mentions one called scientific Linux.
- 4:17Speaker 2: Right, yes, scientists use Scientific Linux specifically because it comes
- 4:22Speaker 2: pre packed with specialized scientific apps and research tools.
- 4:26Speaker 1: There are distros for everything, so if you're listening to
- 4:29Speaker 1: this and want to try it out, replacing your Windows
- 4:31Speaker 1: OS with a Linux distro sounds honestly terrifying for a beginner,
- 4:36Speaker 1: but the book has a safe way to play around.
- 4:37Speaker 2: Right, very safe. The book strongly suggests using a virtual
- 4:41Speaker 2: machine or a VM. You definitely don't need to wipe
- 4:45Speaker 2: your hard drive.
- 4:45Speaker 1: Which is a relief. A VM is basically like the
- 4:48Speaker 1: movie Inception for computers. It's a dream within a dream.
- 4:52Speaker 2: Ah, that's exactly what it is.
- 4:53Speaker 1: It's a computer running inside your host computer. It shares
- 4:57Speaker 1: your physical resources, but acts as a completely standale, isolated machine.
- 5:01Speaker 2: Right, so if you completely break the Linux system while learning,
- 5:04Speaker 2: you just delete the VM and start over. Your actual
- 5:06Speaker 2: computer is totally fine.
- 5:08Speaker 1: The technical specifics in the book are great for this.
- 5:10Speaker 1: You use a program called virtual box, grabbing a Buntu
- 5:13Speaker 1: ISO image and set it up. Alceberry suggests giving it
- 5:16Speaker 1: at least two gigabytes or ideally four gigabytes of RAM
- 5:20Speaker 1: and a dynamically allocated hard disc of at least ten gigabytes.
- 5:24Speaker 2: Four gigs of Ram is really the sweet bot if
- 5:26Speaker 2: you want the graphical interface of a Buntu to run
- 5:29Speaker 2: smoothly without lagging your host machine.
- 5:31Speaker 1: And there's this fun pop culture easter egg in the book.
- 5:34Speaker 1: When you create your username during setup, the author suggests
- 5:37Speaker 1: using Elliott.
- 5:38Speaker 2: A nod to the TV show Mister Robot.
- 5:41Speaker 1: Yep, the hacker main character. It's a great touch. So
- 5:44Speaker 1: you've booted up your Ubuntu virtual machine. You see a
- 5:47Speaker 1: familiar graphical user interface or GUI. You have apps like Libra,
- 5:50Speaker 1: Office and Dash. But to be a true power user,
- 5:54Speaker 1: you have to leave the mouse behind.
- 5:56Speaker 2: You really do. The guy is nice, but the real
- 6:00Speaker 2: of Linux is in the command line.
- 6:02Speaker 1: And this brings up a major point of confusion for beginners,
- 6:05Speaker 1: the difference between the terminal and the shell.
- 6:07Speaker 2: Oh, people mix these up constantly.
- 6:08Speaker 1: Let's go back to the drive through for an analogy.
- 6:11Speaker 1: The terminal is just the drive through speaker box. It's
- 6:13Speaker 1: the physical or emulated window where you speak your order.
- 6:17Speaker 2: Right. The terminal just displays the text. It doesn't actually
- 6:19Speaker 2: understand what you're typing exactly.
- 6:21Speaker 1: But the shell is the line cook wearing the headset
- 6:24Speaker 1: inside the shell is interpreting your order and actually making
- 6:27Speaker 1: the food or you know, executing the commands.
- 6:29Speaker 2: This raises an important question, though, what happens when you
- 6:32Speaker 2: type absolute gibberish into the terminal like you just mash
- 6:35Speaker 2: your keyboard and hit enter.
- 6:37Speaker 1: It doesn't crash, No, not at all.
- 6:38Speaker 2: The shell simply replies command not found. It's a literal interpreter.
- 6:43Speaker 2: If it doesn't recognize the exact order, it just hands
- 6:45Speaker 2: it back to you.
- 6:46Speaker 1: Here's where it gets really interesting to me. I love
- 6:49Speaker 1: how literal Linux commands are. You don't need to memorize
- 6:53Speaker 1: arcane magic spells. The commands are exactly what they do.
- 6:56Speaker 2: The Unix philosophy is to do one thing and do
- 6:59Speaker 2: it well, so the commands are very straightforward.
- 7:02Speaker 1: Let's run through some examples. You type date and it
- 7:05Speaker 1: prints the system date and time simple enough. You type
- 7:08Speaker 1: Michael Fagele it prints the calendar, and I love this.
- 7:11Speaker 1: You can time travel. You can type I'll call twenty
- 7:14Speaker 1: twenty two to see that year, or even autocoll FEP
- 7:17Speaker 1: nineteen ninety three.
- 7:18Speaker 2: Surprisingly fun, just to see what day of the week
- 7:20Speaker 2: you were born on. Yeah.
- 7:22Speaker 1: Then there's clear, which just wipes the screen when it
- 7:25Speaker 1: gets too messy, an echo, which literally repeats back whatever
- 7:29Speaker 1: you type. So if you type echo, cats are better
- 7:31Speaker 1: than dogs, it just prints cats are better than dogs.
- 7:35Speaker 2: Right back, which seems silly at first, but echo is
- 7:39Speaker 2: actually vital later on for writing automated scripts makes sense.
- 7:42Speaker 1: And my absolute favorite history. It shows a number list
- 7:46Speaker 1: of everything you've typed. If you want to run the
- 7:48Speaker 1: seventh command you typed again, you don't retype it. You
- 7:50Speaker 1: just type an exclamation point in the seventh like point seven.
- 7:53Speaker 2: It saves so much time. But commands rarely just run
- 7:56Speaker 2: in their basic state. They have options or flags to
- 7:59Speaker 2: change the behavior.
- 8:00Speaker 1: Right. Let's talk about hyphens, because this confused me at first.
- 8:03Speaker 2: Sure, a single hyphen is for abbreviations like a single letter,
- 8:06Speaker 2: so H. A double hyphen is for full words so human.
- 8:11Speaker 1: So if I want to check my available memory, I
- 8:13Speaker 1: type free, but it gives me the answer in raw kilobytes,
- 8:16Speaker 1: which is practically unreadable for a normal person.
- 8:19Speaker 2: Right, It's just a massive string of numbers.
- 8:21Speaker 1: So you add the option. You can type free H
- 8:23Speaker 1: or free human, and they do the exact same thing.
- 8:25Speaker 1: They display the memory in megabytes or gigabytes, a format
- 8:30Speaker 1: humans can actually read exactly.
- 8:32Speaker 2: Options just modify the command's default behavior. Now, we know
- 8:36Speaker 2: how to ask the computer for the date or its memory,
- 8:39Speaker 2: but how do we ask it how hard it's working
- 8:42Speaker 2: right now?
- 8:43Speaker 1: Taking the system's pulse, that is where the uptime command
- 8:45Speaker 1: comes in. You type it and it shows how long
- 8:47Speaker 1: the system has been running, who is logged in, and
- 8:50Speaker 1: something kind of intimidating called load average.
- 8:52Speaker 2: Load average is a great metric, but it confuses a
- 8:55Speaker 2: lot of people. It outputs three decimal numbers.
- 8:57Speaker 1: Yeah, what exactly do those three numbers mean?
- 9:00Speaker 2: They represent the system load basically the amount of work
- 9:03Speaker 2: the CPU is doing over the past one minute, five minutes,
- 9:06Speaker 2: and fifteen minutes.
- 9:07Speaker 1: So if my system is doing absolutely nothing, what does
- 9:09Speaker 1: it say?
- 9:10Speaker 2: A load average of zero point zero means the system
- 9:12Speaker 2: is completely idle. No processes are waiting in line for
- 9:15Speaker 2: the CPU.
- 9:16Speaker 1: Okay, so why does it give me three different timeframes, one, five,
- 9:20Speaker 1: and fifteen.
- 9:21Speaker 2: Because spotting trends is critical. Let's say your numbers are
- 9:24Speaker 2: two point zero zero four point zero zero zero zero.
- 9:27Speaker 2: The one minute load is a two, but the fifteen
- 9:29Speaker 2: minute load is a six. That means the system load
- 9:32Speaker 2: is much lower now than it was fifteen minutes ago.
- 9:34Speaker 1: Ah, so the system is cooling down exactly.
- 9:37Speaker 2: But if the numbers are reversed like five point zero zero,
- 9:40Speaker 2: three point zero two point zero zero, your one minute
- 9:43Speaker 2: load is way higher. That means the system load is
- 9:45Speaker 2: actively spiking right now.
- 9:46Speaker 1: That's incredibly useful for diagnosing a slow server. And Alcaberi
- 9:50Speaker 1: also notes you can use the lcpu command to quickly
- 9:53Speaker 1: list your CPU architecture and DFAIH to check available disk
- 9:58Speaker 1: space right.
- 9:58Speaker 2: Df stands for disc free, and throwing that H on
- 10:02Speaker 2: there makes it human readable again.
- 10:03Speaker 1: So now we know how the system is feeling and
- 10:05Speaker 1: how hard it's working, but we need to know how
- 10:07Speaker 1: to move around inside its brain. Where are all these
- 10:09Speaker 1: files actually.
- 10:10Speaker 2: Kept the filesystem? This is where Linux is very different
- 10:13Speaker 2: from Windows, which uses C drives and D drives.
- 10:16Speaker 1: Yeah. Algebra explains that the Linux filesystem is like an
- 10:18Speaker 1: upside down tree. It starts at the very top with
- 10:21Speaker 1: the root directory, which is represented simply by a single
- 10:24Speaker 1: forward slash.
- 10:25Speaker 2: Just everything branches out from that single forward slash, and.
- 10:29Speaker 1: To move around you use CD, which stands for change directory.
- 10:32Speaker 1: So CD takes you to the very top, but if
- 10:36Speaker 1: you get lost, use PWD.
- 10:39Speaker 2: Right working directory.
- 10:40Speaker 1: Yes, I love PWD, it's the ultimate you are here
- 10:43Speaker 1: a red star on a mall map. If you're lost,
- 10:46Speaker 1: you just have PbD and it tells you exactly what
- 10:48Speaker 1: folder you're standing in.
- 10:49Speaker 2: It's essential, and once you know where you are, you
- 10:52Speaker 2: use LS to list the files, or ll ls l
- 10:56Speaker 2: e L for a long list that shows all the
- 10:58Speaker 2: file permissions.
- 10:58Speaker 1: The directory structure is so organized too. It's not just
- 11:01Speaker 1: a free for all.
- 11:02Speaker 2: Oh, it is trickly segregated by design. For example, you're
- 11:06Speaker 2: the home directory, which is where regular users live, your documents,
- 11:09Speaker 2: your downloads, but.
- 11:10Speaker 1: The administrator, the root user, doesn't live there.
- 11:12Speaker 2: No, the root user has their own exclusive home called Root.
- 11:15Speaker 2: It's completely separate from regular users to prevent accidental damage.
- 11:19Speaker 1: And then there's Bin and SPIN. Bin holds your essential
- 11:22Speaker 1: everyday programs, your standard binaries, but SPIN holds the system
- 11:26Speaker 1: administration programs.
- 11:28Speaker 2: Right, the tools that require special privileges to run. It
- 11:31Speaker 2: keeps the heavy machinery locked away from the standard tools.
- 11:34Speaker 1: But there is one directory that comes with a massive
- 11:36Speaker 1: warning label, the tempep directory.
- 11:39Speaker 2: Ah, yes, the temporary folder.
- 11:41Speaker 1: This holds temporary files obviously, but the book explicitly warns
- 11:45Speaker 1: you never ever store important files here. Why is that?
- 11:50Speaker 2: Because of how it's mounted. In many systems, TEMP exists
- 11:53Speaker 2: in the system's volatile memory. Yeah, meaning the moment this
- 11:57Speaker 2: system reboots or loses power, that entire wi your folder
- 12:00Speaker 2: is wiped out completely, just poof gone exactly. It's designed
- 12:04Speaker 2: for apps to drop temporary session data and clean it
- 12:07Speaker 2: up automatically. If you save your novel on there and
- 12:10Speaker 2: restart your computer, it is gone forever.
- 12:13Speaker 1: That is a brutal lesson to learn the hard way.
- 12:15Speaker 1: So let's zoom out think about how far we've come
- 12:17Speaker 1: today on this deep dive.
- 12:18Speaker 2: Let's a lot of ground to cover.
- 12:19Speaker 1: We started with understanding Linus Torvald's little nineteen ninety one
- 12:23Speaker 1: hobby project. We talked about spinning up in a Buntu
- 12:27Speaker 1: virtual machine, literally talking directly to the shell with commands
- 12:30Speaker 1: like echo and corticle. We learned how to check the
- 12:33Speaker 1: CPU's load average to spot performance bikes, and navigated the
- 12:37Speaker 1: upside down tree of the root file system.
- 12:39Speaker 2: Once you understand the logic, it's actually incredibly elegant.
- 12:42Speaker 1: So what does this all mean? Why go through the
- 12:44Speaker 1: effort of learning to talk to a machine like this?
- 12:46Speaker 2: Well, I think it leaves you with something really fascinating
- 12:49Speaker 2: to ponder think about this. The very same free, open
- 12:53Speaker 2: source code written by a college student as a fun
- 12:56Speaker 2: hobby in nineteen ninety one is currently washing your clothes.
- 13:00Speaker 2: It's managing global banking clouds. It is literally running the
- 13:04Speaker 2: International Space Station right now.
- 13:05Speaker 1: That is insane to think about.
- 13:07Speaker 2: It really makes you wonder what other small, collaborative, weird
- 13:11Speaker 2: little hobbies happening on the Internet right now might quietly
- 13:15Speaker 2: become the invisible infrastructure of our future.
- 13:18Speaker 1: A hobby today, the invisible engine of the world tomorrow.
- 13:21Speaker 1: Thanks for taking this deep dive with us, and we'll
- 13:23Speaker 1: see you on the next one.