# Linux
---
## Contents
- File system
- Users and groups
- archive file formats
- CLI
- GUI
- Packages
- Daemons

## File system
### file system anatomy
-`/`; root directory
-`/home`; home directory of current user
-`/usr`; home directory for root
-`/dev`; connected devices and hardware components listed as files
-`/bin`; binary files for executable programs (packages)
-`/proc`; processes listed as files
-`/lib`; 
-`/etc`; configuration files
-`/mnt`; mounting directory for external storage devices
-`/srv`; server directory
-`/opt`
### file system formats
- FAT32
- ext4
- Path
- Directory
- /etc/fstab (device list)
file systems contain a variety of objects
- file; collection of data
- directory; collection of files/directories
- soft link (symlink); link that redirects to some file
- hard link; link that directly accesses the same data as some file


## Users and groups
### Users
Users are entities that pass input to a CLI/GUI
### Groups
A collection of users may belong to a *group*, some files/directories give special permissions to users of the same group as the file/directory's owner
### Permission
- user permissions; permissions for the file owner
- group permissions; permissions for users that share a group with the file owner
- other permissions; permissions for users that don't share a group with the file owner
- read permission; permission to read a file
- write permission; permission to write to a file
- execute permission; permission to execute a file or enter a directory
User information is stored in the following files
- /etc/passwd (user list)
- /etc/shadow (password hashes)



## Archive file formats
### Archive formats; file formats that combine several files into one
Tape archive (.tar)
ISO-9960 image (.iso)
### Compression formats; file formats that compress single files
gzip (.gz)
bzip2 (.bz2)
lzip (.lz)
xz (.xz)
Zstandard (.zst)
### Archive-Compression formats; archive formats that are subsequently compressed
7z (.7z)
APK (.apk)
JAR (.jar)
RAR (.rar)
ZIP (.zip)
Apple Disk Image (.dmg)



## CLI
CLI is an interface where users may only interact with a *shell*; a prompt where users interact with programming
- bash
- sh
- zsh
- csh
- ksh
## GUI
GUIs are interfaces with graphical capabilities to allow for applications to make use of windows, icons, menus, pointers etc. (WIMP)
GUIs require software and standards to connect user input to GUI behaviour and to define basic GUI structures; this is a *Window system*
- X Window server (X11); Window server providing a basic framework for graphical environments
- Xorg (open source X11); open source version of X11
- Wayland

Window systems employ *widget toolkits* to display and define behaviour of widgets such as checkboxes, buttons, textfields etc.
- GTK
- Qt

There are 2 popular types of GUI envrionments:
- Desktops
	- GNOME
	- XFCE
- Window managers
	- i3
	- twm


## Packages
- Package manager
	- pacman
	- APT
	- yum
- Dependency; the concept of packages requiring the installation of other auxiliay packages
- Signature
Software update models
- Rolling release
- Point release



## Daemons
- Daemon; backgorund process
### init daemons
- systemd
### Networking daemons
- NetworkManager
- systemd-networkd
- iwd
- /etc/hosts (blacklisted ips)
- /etc/hostmane (device name)
- /etc/resolv.conf (DNS resolution server)
### Audio daemons
Advanced Linux Sound Architecture (ALSA); Sound drivers and API for linux (better modern support)
Open Sound System (OSS); Sound drivers for linux (better legacy support)
PulseAudio; Middleware for ALSA or OSS



# Archlinux
---
## Principles
- simplicity
- modernity
- pragmatism
- user centrality
- versatility
## Packages
- pacman; package manager for Arch linux that can manage from official repository
- Arch User Repository (AUR); Repository of non-official packages
- Arch Linux Archive (ALA); Archive of older versions on packages
- /var/cache/pacman/pkg (cache of previous versions of packages, try this before visiting ALA)
## Key signing
- openPGP
## Web of trust
- 5 master signing keys (these are keys an Arch user can choose to marginally trust)
- trust (marginal/full); property of a key that is used to discern validity of related keys
- validity (marginal/full); property representing validity of a key
- Signed by own key, a fully trusted key, or 3 marginally trusted keys
- Maximum of 5 degrees of separation from signedkey to your key
- Revoker; key that can revoke a master signing key




initialrd; scheme that loads a filesystem into RAM for startup process
