4 ms·
Ask HN: Learning Linux from Scratch
I'm interested in learning Linux and have minimal knowledge about operating systems and kernels. Can you recommend resources that cover everything from the basics to advanced topics?
Do I need to have knowledge of OS before understanding Linux kernal.
- eimrine 2y agoTry Debian, read any book you find comfortable, do not forget practicing in terminal. You are not going to have knowledge of OS or understanding the kernel anytime soon because it requires you to know C programming language.
- rickcarlino 2y agoCompiling a Linux kernel and system from source components onto a Raspberry Pi can be educational. I wrote a quick guide on the topic years ago: https://rickcarlino.com/2021/build-a-raspbery-pi-linux-system-the-hard-way.html https://rickcarlino.com/2021/build-a-raspbery-pi-linux-syste... There is also a Buildroot guide, but going low level first might be more educational.
- djaouen 2y ago1. Install Linux Mint. 2. Try to do everything (yes, even web browsing) through the terminal. (You can go back to browsing in a non-terminal browser later). 3. Read Kernighan and Pike's "The Unix Programming Environment". 4. Mess around with neovim/emacs. 5. You will now have an understanding of Linux as a user. Where you go from here is up to you! Cheers.
- hiAndrewQuinn 2y agoIf you're going to go "bottom up": You probably should know about operating systems in general, yes. Linux has been heavily refined and optimized over the years, so having some basic framework to think through will be very worth it. I recommend Operating Systems: Three Easy Pieces for self study: https://pages.cs.wisc.edu/~remzi/OSTEP/ https://pages.cs.wisc.edu/~remzi/OSTEP/ If you're going to go "top down": Take the plunge and install Linux on your home computer. Put in the time to get it working exactly at you wanted. Then read The Linux Programming Interface, which covers userland in excellent detail. Now you're ready to pierce the veil and finally start understanding the kernel.
- beardyw 2y agoTop down - don't try to understand how something works before you understand what it does.
- fractallyte 2y agohttps://www.linuxfromscratch.org/ https://www.linuxfromscratch.org/
- andrewstuart 2y agoYou didn’t say why. How you learn Linux depends heavily on your goals, why you are wanting to learn, what you want to do, what outcomes you’re wanting.
- palata 2y agoIMHO, the first step would be to learn how to use Linux (if that's not done). For that, just install some Linux distro and use it. Maybe start with Ubuntu, and try to use the command line as much as possible (instead of using the graphical user interface). When you feel comfortable with Ubuntu, maybe try Arch Linux. You will learn a lot just by installing and configuring Arch (but you will be lost if you have no experience of Linux, hence something like Ubuntu first). Arch Linux has a very good documentation! When you feel comfortable with Arch, try compiling packages manually. With the Arch AUR you can do that pretty easily (get a PKGBUILD and build the package). Again, that's all documented by Arch Linux! When you feel comfortable building packages manually, maybe it's time to try Linux from Scratch: https://www.linuxfromscratch.org/ https://www.linuxfromscratch.org/. It will go one step further than the way you installed Arch Linux, and this time you will compile all the packages manually! At this point you will have learned a lot and it will be easier to see how to move more into the kernel. Note that this is just my opinion: maybe you can get into the Linux kernel without understanding how the Linux OSes work, but... well that's not how I would do it :-).
- brudgers 2y agoThe Design of the Unix Operating System by Maurice Bach is readable and provides a very good high level overview that overlaps Linux. https://archive.org/details/DesignUNIXOperatingSystem/page/n1/mode/1up https://archive.org/details/DesignUNIXOperatingSystem/page/n... Operating Systems, Three Easy Pieces is a reasonable book about operating systems in general. https://pages.cs.wisc.edu/~remzi/OSTEP/ https://pages.cs.wisc.edu/~remzi/OSTEP/ If you are going to run Linux, I recommend Ubuntu as the easy path. There are good arguments for other distros. But you probably don’t need an argument.
- catanama 2y agoIn my experience learning something comes from playing with it. So allow me shameless plug: https://archive.is/xDb8o https://archive.is/xDb8o This is a Linux tutorial I wrote quite some time ago but it's still relevant, it tries to give you some hands-on overview of Linux system by having you to execute commands and understand the output. It goal is to just go through it to familiarize yourself with different parts of the systems. There is verbose table of contents on the first page if you scroll down.
- vednig 2y agoBest way to learn Linux is by building it. Checkout https://www.linuxfromscratch.org/ https://www.linuxfromscratch.org/ Follow it through But before that read through Operating System Principles by Gelvin,Gagne
- nesarkvechnep 2y agoMy advice is, if your aim is to study, to give FreeBSD a try. It's a complete operating system - the kernel and the userspace are developed by the same team. FreeBSD has fewer moving pieces and is very stable.
- manx 2y agohttps://www.arcolinux.info/ https://www.arcolinux.info/ might be interesting to you
- ketanmaheshwari 2y agoThis may be a good starting point: https://linuxupskillchallenge.org/ https://linuxupskillchallenge.org/
- hackermailman 2y agoThere's some good lectures from CMU if you search for 15-213 on YouTube. The lectures explain how x86-64 works and enough about operating systems you know how virtual memory and signals work. Then any OS resource listed here or try MITs it has YouTube lectures https://pdos.csail.mit.edu/6.828/2021/schedule.html https://pdos.csail.mit.edu/6.828/2021/schedule.html