Linux
Table of Contents
1. Abstract
- this a fairly vast umbrella node that helps pedagogically cover several concepts in computer science.
- a structured end to end walk through will follow some day but as of now, stitching together what I need in the moment patch by patch.
2. Misc
2.1. Virtualization
2.2. The Linux File System
Tree like, follows the file system hierarchy standard (FHS). With root level as currect file (directories are file as well), run:
tree -D -L 1 /
2.2.1. /
- the top level of the file system
- The "root"
2.2.2. /root
- home directory for the root users
- root specific configs, etc all go in here
2.2.3. /home
- users' specific files in respective user directories
- default login directories placed here
2.2.4. /boot
- essentials needed to boot up a system
- bootloader files
- root filesystem files
- linux kernel files
- other boot configuration
2.2.5. /bin
- contains common binaries executable by all users in single-user mode
- check the loc of the bin you want to examine via
which
2.2.6. /sbin
- system binaries and executables reserved for the root user
- for instance, reboot..
2.2.7. /dev
- representative files of devices attached to the system
- consoles, hard drives, peripherals
- also server a storage for pseudo/virtual devices with no actual hardware associated to them
- /dev/null for instance is a bottomless pit for bytes streamed into it
2.2.8. /etc
- host specific system wide configuration files in here
- configs for programs, startup and shutdown shell scripts
2.2.9. /lib, /lib32, /lib64
- shared library images required by /bin and /sbin
- arch specific 32 and 64 if needed
2.2.10. /media
- temporary sub directories on which removable media is automatically mounted
- /media/cdrom for instance
2.2.11. /mnt
- temporary mount point for removable media
- mostly used to mount storage devices and partitions manually
2.2.12. /tmp
- temporary files
- cleaned upon reboot
2.2.13. /opt
- third party repository installations go in here
- think add-ons
- software binaries manually compiled by the user go here
2.2.14. /var
- variable files go here (constantly changing in size)
- /var/log - Contains system and application log files.
- /var/cache - Contains cached data from programs.
- /var/mail - Contains users’ mailboxes
- /var/spool - Comprises queued or spooled files for various programs.
- /var/spool/cron - Contains spooled files for cron jobs.
- /var/spool/at - Contains spooled jobs for at.
- /var/spool/lpd - Contains spooled files for printing.
- /var/opt - Contains variable data files for the /opt directory.
- spools are short term buffers where data is cached before it can be processed (printing to the terminal for instance)
Simultaneous Peripheral Operations On-Line
2.2.15. /run
- stores volatile run time data
- not persistent across reboots
2.2.16. /proc
- virtual file system : special files for running processes and kernel's current state
- information and control center of the linux kernel
- pseudo cause doesn't exist when system powered off
- mounted on /proc when booting up
2.2.17. /usr
- libraries, binaries and documentations for installed software applications
2.2.18. /srv
- srv = service
- site specific data for that linux distro
- points to loc of files for specific services (www, FTP, rsync, CVS)
2.2.19. /sys
- pseudo file system for virtual files attached to the linux kernel
2.3. Init System
2.4. Cgroups
2.5. Linux NameSpaces
- provide processes with their own view of the system
- drop in conceptual replacement for UIDs
- namespaces available in modern kernels:
- checkout : https://container.training/intro-selfpaced.yml.html#705
2.5.1. Types and Functions:
- PID: Isolates process IDs. A process in one PID namespace can't see or interact with processes in another.
- Network: Provides a separate network stack (interfaces, routing tables) for each namespace.
- Mount: Isolates mount points, allowing containers to have their own file system views.
- UTS: Isolates hostname and domain name.
- IPC: Isolates inter-process communication mechanisms.
- User: Isolates user IDs and groups.
2.6. Linux Security Modules (LSMs)
- checkout : https://www.starlab.io/blog/a-brief-tour-of-linux-security-modules
- also see : https://kubearmor.io/