Administration#
Administration is the operator’s home turf. Configure the system, run its services, watch its logs, and keep the box honest between operations. The same dotfiles, units, timers, and journal queries are in play whether the host is a personal workstation, a redirector, a sensor, or a captured target.
The files and commands below are the everyday reach (shell startup,
environment, systemd units, journal, package and user state).
Master them on home turf and the same primitives translate the moment
the operator lands on someone else’s box.
Files#
Configuration files for the everyday shell and CLI tooling. These are where the operator’s environment, history, completions, and personal aliases live (the dotfiles that travel with you from one machine to the next, and the system-wide files that override them when present).
Shell Startup#
Path |
Purpose |
|---|---|
|
System-wide login-shell init |
|
Snippets sourced by |
|
System-wide interactive Bash init |
|
Per-user login shell |
|
Per-user interactive Bash |
|
Runs at login-shell exit |
|
Zsh interactive |
|
Zsh login-shell init |
|
Zsh environment (every invocation) |
|
Zsh post-login init |
|
Fish config |
|
readline (line editor) config |
|
System-wide readline |
|
Bash command history |
|
Zsh command history |
Environment#
Path |
Purpose |
|---|---|
|
System-wide env vars ( |
|
Per-user PAM environment (mostly deprecated) |
|
Locale defaults |
|
Timezone name (Debian) |
|
Timezone binary (symlink to |
Editors (config files)#
Path |
Editor |
|---|---|
|
Vim |
|
Neovim |
|
Emacs |
|
VS Code |
|
Helix |
|
Default editor for tools (env var) |
Pagers and Viewers#
Variable / file |
Purpose |
|---|---|
|
Default |
|
|
|
|
|
|
|
Override the man-page pager |
|
Default pager for many tools |
Multiplexers#
Path |
Tool |
|---|---|
|
tmux config (legacy path) |
|
tmux config (XDG path) |
|
GNU screen |
|
Zellij |
Version Control (config files)#
Path |
Purpose |
|---|---|
|
System-wide Git config |
|
Per-user Git config |
|
Global ignore (referenced via |
|
GPG keys and trustdb |
|
|
Networking (config files)#
Path |
Purpose |
|---|---|
|
|
|
|
|
|
|
Credentials for FTP / curl / git (mode |
|
Per-host SSH client options |
Terminal#
Path / variable |
Purpose |
|---|---|
|
System terminfo capability database |
|
Distribution-installed terminfo |
|
Selects which terminfo entry to use |
|
Alacritty config |
|
Kitty config |
|
WezTerm config |
|
Ghostty config |
XDG Base Directories#
Many modern CLIs follow the XDG Base Directory specification.
Variable |
Default |
|---|---|
|
|
|
|
|
|
|
|
|
|
Shells#
The interactive shell is the operator’s primary interface to the system. Bash is the practical default. Zsh ships on macOS and is widely adopted on Linux desktops. Fish trades POSIX compatibility for ergonomics. Alternatives like Nushell and Elvish reframe the shell as a structured-data tool.
Tool |
Purpose |
|---|---|
|
GNU Bourne Again Shell, the typical default |
|
Batteries-included interactive shell (macOS default) |
|
Friendly interactive shell with built-in syntax highlighting |
|
Minimal POSIX shell (Debian’s |
|
Almquist shell (Alpine, BusyBox) |
|
KornShell, POSIX with array support; common on AIX/Solaris |
|
Enhanced C shell |
|
Modern structured-data shell |
|
Structured-data shell ( |
|
Python-powered shell |
Example.
$ echo "$SHELL"
$ chsh -s /usr/bin/zsh
$ exec bash
Text Processing#
Slicing log files, config, and tabular data is daily operator work.
The classic Unix tools (grep, sed, awk, cut,
sort, uniq, tr) compose into pipelines that handle
anything line-oriented. The modern alternatives below are faster or
friendlier for specific kinds of data.
Tool |
Purpose |
|---|---|
|
Pattern search |
|
Faster grep with |
|
Stream editor (substitute / transform) |
|
Field-aware text processor |
|
Extract columns by delimiter / position |
|
Translate or delete characters |
|
Sort lines |
|
Collapse / count adjacent duplicate lines |
|
Copy stdin to file and stdout |
|
Build commands from stdin |
|
File-system search (filters + actions) |
|
Friendlier |
|
JSON query and transform |
|
YAML / TOML / XML query (mikefarah or kislyuk) |
|
|
|
Prettier |
|
Fuzzy finder for everything |
|
Format input into aligned columns |
|
Merge corresponding lines from files |
|
Join lines on a common field |
|
Compare two sorted files line by line |
Example.
$ grep -RIn 'TODO' src/
$ sed -i 's/foo/bar/g' file.txt
$ awk '{ sum += $2 } END { print sum }' data.tsv
$ cut -d: -f1 /etc/passwd
$ sort -u file | uniq -c | sort -rn
Monitoring#
Live system and process state. Where ps and top give a
snapshot of what is running, the tools below add color, sortable
columns, and per-resource focus. htop and btop cover general
use, iotop and iftop cover I/O and network breakdowns, and
glances provides an all-in-one dashboard.
Tool |
Purpose |
|---|---|
|
Built-in process viewer |
|
Friendlier top |
|
Modern resource-monitor TUI |
|
Cross-platform top with plugins |
|
Load averages |
|
CPU / memory / IO summary |
|
Detailed disk I/O ( |
|
Historical metrics ( |
|
Memory summary |
|
Per-process CPU |
|
Per-process disk I/O |
|
Per-interface network bandwidth |
|
Per-process network bandwidth |
|
Bandwidth monitor |
|
Combined system stats |
|
Logging top variant |
Example.
$ htop
$ vmstat 1 5
$ iostat -xz 1
$ sudo iotop -ao
Editors#
Every operator picks an editor and learns it well; it is the tool
you spend the most time inside. The terminal editors below all run
from a fresh shell on any host. The GUI ones (code, zed) suit
the operator’s own workstation.
Tool |
Purpose |
|---|---|
|
Modal editor; ubiquitous |
|
Modern Vim fork with Lua scripting |
|
Friendliest terminal editor |
|
Extensible editor / Lisp environment |
|
Modern terminal editor with familiar keybindings |
|
Modal editor with built-in LSP |
|
VS Code (GUI) |
|
VS Code without telemetry |
|
Modern collaborative editor |
|
POSIX line editor |
|
POSIX visual editor |
Example.
$ ${EDITOR:-vi} file.txt
$ nvim +"set number"
$ helix file.rs
File Transfer#
Move bytes between hosts, with or without an intermediate. scp and
rsync are the standard SSH-based options. rsync wins for
repeated runs because it transfers only deltas. curl and wget
cover one-off HTTP fetches. croc and magic-wormhole handle
ad-hoc transfer between non-matched endpoints.
Tool |
Purpose |
|---|---|
|
Incremental sync over SSH or local |
|
One-shot SSH copy |
|
Interactive secure FTP |
|
Remote shell (transfer via stdin/stdout) |
|
Single-file HTTP/HTTPS/FTP fetch |
|
Recursive HTTP/FTP download |
|
Multi-source / multi-protocol downloader |
|
Encrypted host-to-host file transfer |
|
Codephrase-based transfer |
Example.
$ rsync -aP src/ user@host:/path/
$ scp file user@host:/path/
$ sftp user@host
Archives#
Bundle a tree of files into a single archive, optionally compressed.
tar is the universal Unix container. Pair it with gzip,
bzip2, xz, or zstd (modern default) for compression.
zip and 7z cover cross-platform interchange where the
recipient is on Windows or macOS.
Tool |
Purpose |
|---|---|
|
Universal Unix archive (combine with a compressor) |
|
Single-file gzip compression |
|
bzip2 compression |
|
xz / LZMA compression |
|
Modern fast / good-ratio compressor |
|
Very fast compressor for high-throughput |
|
Cross-platform ZIP archives |
|
7-Zip; multi-format with strong compression |
|
Legacy archive (initramfs, RPM) |
|
Static-library archive ( |
Example.
$ tar -czf out.tgz dir/
$ tar -xzf out.tgz
$ tar --zstd -cf out.tar.zst dir/
$ zip -r out.zip dir/
Disk and Filesystem#
Inspect, lay out, and grow the storage stack from the userspace side. The first three commands answer “where is the space going”. The next group answers “what physical and logical devices exist”. The rest cover partitioning, formatting, and the LVM and LUKS layers above the raw block device.
Tool |
Purpose |
|---|---|
|
Free space per mounted filesystem |
|
Disk usage of files and directories |
|
Interactive |
|
|
|
Block devices and mountpoints (tree view) |
|
UUIDs and filesystem types |
|
Mount tree |
|
SMART data ( |
|
Discard unused blocks on SSDs |
|
Attach / detach filesystems |
|
GPT/MBR partition editor |
|
Classic / GPT-only partition editor |
|
Create a filesystem on a device |
|
Adjust ext2/3/4 parameters |
|
Grow / shrink an ext filesystem |
|
Grow an XFS filesystem |
|
Manage LUKS-encrypted volumes |
|
Software RAID |
|
Logical-volume manager |
Example.
$ df -h
$ du -sh dir/
$ lsblk -f
$ sudo smartctl -a /dev/sda
$ sudo fstrim -av
Containers#
Build, run, inspect, and ship OCI containers. Docker is the dominant interface. Podman is a daemonless drop-in that the RHEL family ships by default. Kubernetes is the orchestrator most operators encounter at scale. The other tools fill specific gaps in the build, transfer, and runtime layers.
Tool |
Purpose |
|---|---|
|
The original container CLI / daemon |
|
Daemonless, rootless drop-in for Docker |
|
The runtime under Docker / Kubernetes |
|
Docker-compatible CLI for containerd |
|
OCI image builder (Podman family) |
|
Image transfer / inspection across registries |
|
Low-level OCI runtime |
|
Lightweight C OCI runtime |
|
System containers |
|
Kubernetes CLI |
|
Local Kubernetes cluster |
|
Kubernetes in Docker |
|
k3s in Docker |
|
Kubernetes package manager |
|
Multi-container orchestration (compose file) |
Example.
$ docker run --rm -it ubuntu:24.04 bash
$ docker compose up -d
$ podman run --rm -it alpine sh
$ kubectl get pods -A
Version Control#
Git has won the version-control space, so this section is mostly Git
tooling (the core CLI, the TUIs that make history and staging easier
to read, and the platform CLIs gh and glab that bring pull
requests and issues into the terminal). Older systems are listed for
legacy work.
Tool |
Purpose |
|---|---|
|
The ubiquitous DVCS |
|
TUI for Git history |
|
TUI for Git operations |
|
GitHub CLI |
|
GitLab CLI |
|
Repository browser (Tk GUI) |
|
Large File Storage extension |
|
Apache Subversion (legacy) |
|
Mercurial |
|
Self-contained DVCS + bug tracker |
|
Bazaar / Breezy |
Example.
$ git status
$ git log --oneline --graph -20
$ gh pr create
$ lazygit
System Inventory#
Answer “what kind of box am I on” with one of these commands.
uname and hostnamectl cover OS and kernel. lscpu,
lsmem, lspci, and lsusb cover the hardware tree.
dmidecode reads BIOS / SMBIOS strings (vendor, model, serial).
inxi rolls most of the above into one summary.
Tool |
Purpose |
|---|---|
|
Kernel name, version, architecture |
|
Hostname, OS, kernel, virtualization |
|
Distribution release info |
|
CPU details |
|
Memory details |
|
PCI devices |
|
USB devices |
|
Comprehensive hardware listing |
|
Hardware (BIOS / DMI tables) |
|
Friendly summary report |
|
Terminal-art system summary |
|
Memory summary |
|
CPU count |
|
System configuration values |
Example.
$ uname -a
$ hostnamectl
$ lsb_release -a
$ cat /etc/os-release
$ lscpu
$ lshw -short
Common Tasks#
Fingerprint the host. Distro, kernel, hostname, uptime.
$ hostnamectl
$ uname -a
$ cat /etc/os-release
$ uptime; w
Inventory CPU, memory, disk. The capacity baseline.
$ lscpu
$ free -h
$ lsblk -f
$ df -hT
Identify environment. VM, container, cloud instance, bare metal.
$ systemd-detect-virt
$ sudo dmidecode -s system-manufacturer
$ curl -s -H 'Metadata-Flavor: Google' http://169.254.169.254/computeMetadata/v1/instance/ 2>/dev/null
$ curl -s http://169.254.169.254/latest/meta-data/ 2>/dev/null
Inventory installed software. The package state.
$ dpkg -l 2>/dev/null | head
$ rpm -qa 2>/dev/null | head
$ pacman -Q 2>/dev/null | head
Capture a one-shot snapshot. Single command, useful for tickets and ARR.
$ inxi -Fxxxz 2>/dev/null
$ neofetch --stdout 2>/dev/null
$ ( hostnamectl; uname -a; uptime; free -h; df -hT ) | tee /tmp/baseline.txt
Set hostname, timezone, locale. One-time host setup.
$ sudo hostnamectl set-hostname web-01
$ sudo timedatectl set-timezone America/New_York
$ timedatectl set-ntp true
$ sudo localectl set-locale LANG=en_US.UTF-8
Read system logs. The daily triage view.
$ journalctl -p err -b
$ journalctl -u <unit> --since '1 hour ago' -f
$ dmesg -T | tail -50
$ tail -F /var/log/syslog /var/log/messages 2>/dev/null
Schedule recurring work. Cron, anacron, systemd timers.
$ crontab -l; sudo crontab -l
$ sudo crontab -e
$ ls -la /etc/cron.{hourly,daily,weekly,monthly}/
$ systemctl list-timers --all
Reboot and shutdown. With notice and a cancel path.
$ sudo shutdown -r +5 'kernel update'
$ sudo shutdown -h now
$ sudo systemctl reboot
$ sudo shutdown -c
Backup and restore a host. Before risky changes.
$ sudo tar --acls --xattrs -czf /backup/etc-$(date +%F).tgz /etc
$ rsync -aHAX --numeric-ids /home/ /backup/home/
$ sudo dpkg --get-selections > /backup/pkglist.txt
$ sudo timeshift --create --comments 'pre-upgrade' 2>/dev/null
References#
man bash,man zsh,man fish(interactive shells; seebash§ INVOCATION andzsh§ STARTUP/SHUTDOWN FILES for startup-file order).man 5 environment,man 5 locale.conf,man timedatectl(system environment, locale, time).man vim,man nano,man emacs(terminal editors).man less,man man(pagers).man tmux,man screen(terminal multiplexers).man git,man git-config,man gpg(version control and signing).man curl,man wget,man 5 netrc,man ssh_config(network clients and credentials).man terminfo,man tput,infocmp(terminal capabilities).man rsync,man scp,man sftp(file transfer).man tar,man gzip,man zstd,man xz(archives and compression).man grep,man sed,man awk(text processing).man top,man vmstat,man iostat,man sar(live monitoring).man df,man du,man lsblk,man smartctl,man cryptsetup(disk and filesystem).man uname,man hostnamectl,man lscpu,man dmidecode(system inventory).Packages for distribution identification.
Processes for the process tree and signals.
Services for systemd unit and timer management.
Filesystem for layout, mounting, and compression.
Shells for per-shell startup conventions.
Linux for the command quick-reference.
Bash for common Bash one-liners.
Signals and Exit Codes, Filesystems for reference tables.