LEARN LINUX THE RIGHT WAY

Posted on Jan 6, 2022

WHAT IS LINUX?

  • Concept of a kernel
    • Hardware <-> Kernel <-> Software
    • Monolithic kernel vs Microkernel
  • Open source nature
    • Worldwide development
    • You can contribute to it

WHAT IS A LINUX DISTRIBUTION

  • OS based on monolithic Linux kernel

WHAT MAKES A LINUX DISTRIBUTION

  • Core: libc; Base: coreutils; Extras;
    • Most Linux distros differ on Extras

DIFFERENCE BETWEEN LINUX DISTROS

  • User-friendly vs user-centric distros
  • Rolling release vs fixed release
    • Linux Mint vs Arch
  • Binary vs Source based

INSTALLING SOFTWARE ON A LINUX DISTRO

  • A linux distro distributes packages
  • Package manager: apt, pacman
    • ´apt install firefox´
    • ´pacman -S firefox´

FLEXIBILITY OF LINUX

  • Used on super computers
    • 100% of top 500
  • Used on the server
    • 96% of top 1,000,000
  • Used on personal computers

INTRODUCTION TO THE TERMINAL

  • Commands are programs
    • ls, cd, cat, pwd, whoami, echo, ps
    • Learn every command: ´man command´
  • Everything is a file
    • Programs, devices and drivers are files
    • ´ls /dev´, ´ls /bin´

AUTOMATION AND SCRIPTING

  • Bash scripts
    • Shell vs Terminal
    • Variables: PATH, export, env
    • ´#!/bin/bash´ vs ´#!/bin/sh´
  • Version control system (VCS)
    • Git: pull, push, commit, branch, log, status

HARDWARE AND SYSTEM CONFIGURATION

  • Configure and verify network connection
    • ping, ip, nmtui, nmcli
  • Boot process
    • Bootloader: grub
    • Boot modules and files: mkinitrd, dracut, initramfs, vmlinuz, grub-mkconfig
  • Install, configure and monitor kernel modules
    • dmesg, lsmod, modprobe
  • Manage storage
    • Partitions: GPT, MBR
    • Linux file system hierarchy: ´ls /´
    • File system types: ext4, btrfs, xfs
  • Virtualization
    • Type 1 vs type 2 hypervisor
    • KVM: Kernel virtual machine

OPERATION AND MAINTENANCE

  • Install, update and remove software
    • Package managers: apt, dnf, pacman
    • Build tools: Makefile and compiling
  • Manage user and groups
    • Create: useradd, groupadd
    • Modify: usermod, groupmod, passwd
  • Create, modify and redirect files
    • Text editors: vim, nano
    • Read files: cat, grep, less
    • File operations: touch, mv, cp, rm, ln
  • Manage services (systemd)
    • Using systemctl: start, stop, enable, status, restart
  • Linux graphical user interface
    • Servers: Xorg, Wayland
    • DE/GUI: Gnome, KDE, xfce, Cinnamon
    • Remote desktop: VNC, XRDP, Spice

LINUX SECURITY

  • User/group permissions
    • ´ls -l´, chmod, chown, chgrp, rwx
  • Athentication methods
    • SSH: Public and Private keys
  • Firewall
    • UFW: Uncomplicated firewall
  • Compress files
    • Compression: gzip, xz, bzip2
    • Integrety checks: MD5, SHA

TROUBLESHOOTING AND DIAGNOSTICS

  • Analyse system properties
    • Network: ping, nmap, netstat, tcpdump, wireshark, traceroute, arp, ip, nmcli
    • Storage: iostat, df, du
    • CPU: uptime, lscpu
    • Memory: free, swap
  • Analyse system processes
    • ps, time, pgrep, pkill
  • Troubleshooting user issues
    • Permissions and authentication
  • Application and hardware issues
    • Storage, firewall, permission, dependencies