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

/etc/profile

System-wide login-shell init

/etc/profile.d/*.sh

Snippets sourced by /etc/profile

/etc/bash.bashrc

System-wide interactive Bash init

~/.bash_profile / ~/.profile

Per-user login shell

~/.bashrc

Per-user interactive Bash

~/.bash_logout

Runs at login-shell exit

~/.zshrc

Zsh interactive

~/.zprofile

Zsh login-shell init

~/.zshenv

Zsh environment (every invocation)

~/.zlogin

Zsh post-login init

~/.config/fish/config.fish

Fish config

~/.inputrc

readline (line editor) config

/etc/inputrc

System-wide readline

~/.bash_history

Bash command history

~/.zsh_history

Zsh command history

Environment#

Path

Purpose

/etc/environment

System-wide env vars (KEY=value, no shell syntax)

~/.pam_environment

Per-user PAM environment (mostly deprecated)

/etc/locale.conf

Locale defaults

/etc/timezone

Timezone name (Debian)

/etc/localtime

Timezone binary (symlink to /usr/share/zoneinfo)

Editors (config files)#

Path

Editor

~/.vimrc

Vim

~/.config/nvim/init.lua

Neovim

~/.emacs / ~/.emacs.d/init.el

Emacs

~/.config/Code/User/settings.json

VS Code

~/.config/helix/config.toml

Helix

$EDITOR / $VISUAL

Default editor for tools (env var)

Pagers and Viewers#

Variable / file

Purpose

$LESS

Default less options

$LESSCHARSET

less character-set override

$LESSHISTFILE

less search-history file

~/.lesshst

less history (default)

$MANPAGER

Override the man-page pager

$PAGER

Default pager for many tools

Multiplexers#

Path

Tool

~/.tmux.conf

tmux config (legacy path)

~/.config/tmux/tmux.conf

tmux config (XDG path)

~/.screenrc

GNU screen

~/.config/zellij/config.kdl

Zellij

Version Control (config files)#

Path

Purpose

/etc/gitconfig

System-wide Git config

~/.gitconfig

Per-user Git config

~/.gitignore_global

Global ignore (referenced via core.excludesfile)

~/.gnupg/

GPG keys and trustdb

~/.password-store/

pass password store

Networking (config files)#

Path

Purpose

~/.curlrc

curl defaults

~/.wgetrc

wget per-user defaults

/etc/wgetrc

wget system defaults

~/.netrc

Credentials for FTP / curl / git (mode 0600)

~/.ssh/config

Per-host SSH client options

Terminal#

Path / variable

Purpose

/etc/terminfo/

System terminfo capability database

/usr/share/terminfo/

Distribution-installed terminfo

$TERM

Selects which terminfo entry to use

~/.config/alacritty/

Alacritty config

~/.config/kitty/

Kitty config

~/.config/wezterm/

WezTerm config

~/.config/ghostty/

Ghostty config

XDG Base Directories#

Many modern CLIs follow the XDG Base Directory specification.

Variable

Default

$XDG_CONFIG_HOME

~/.config

$XDG_CACHE_HOME

~/.cache

$XDG_DATA_HOME

~/.local/share

$XDG_STATE_HOME

~/.local/state

$XDG_RUNTIME_DIR

/run/user/<uid>

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

bash

GNU Bourne Again Shell, the typical default

zsh

Batteries-included interactive shell (macOS default)

fish

Friendly interactive shell with built-in syntax highlighting

dash

Minimal POSIX shell (Debian’s /bin/sh)

ash

Almquist shell (Alpine, BusyBox)

ksh

KornShell, POSIX with array support; common on AIX/Solaris

tcsh

Enhanced C shell

elvish

Modern structured-data shell

nushell

Structured-data shell (nu)

xonsh

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

grep

Pattern search

ripgrep / rg

Faster grep with .gitignore awareness

sed

Stream editor (substitute / transform)

awk / gawk / mawk

Field-aware text processor

cut

Extract columns by delimiter / position

tr

Translate or delete characters

sort

Sort lines

uniq

Collapse / count adjacent duplicate lines

tee

Copy stdin to file and stdout

xargs

Build commands from stdin

find

File-system search (filters + actions)

fd

Friendlier find

jq

JSON query and transform

yq

YAML / TOML / XML query (mikefarah or kislyuk)

bat

cat with syntax highlighting

delta

Prettier git diff

fzf

Fuzzy finder for everything

column

Format input into aligned columns

paste

Merge corresponding lines from files

join

Join lines on a common field

comm

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

top

Built-in process viewer

htop

Friendlier top

btop

Modern resource-monitor TUI

glances

Cross-platform top with plugins

uptime

Load averages

vmstat 1

CPU / memory / IO summary

iostat -xz 1

Detailed disk I/O (sysstat)

sar

Historical metrics (sysstat)

free -h

Memory summary

pidstat 1

Per-process CPU

iotop

Per-process disk I/O

iftop

Per-interface network bandwidth

nethogs

Per-process network bandwidth

bmon

Bandwidth monitor

dstat

Combined system stats

atop

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

vim

Modal editor; ubiquitous

neovim (nvim)

Modern Vim fork with Lua scripting

nano

Friendliest terminal editor

emacs

Extensible editor / Lisp environment

micro

Modern terminal editor with familiar keybindings

helix (hx)

Modal editor with built-in LSP

code

VS Code (GUI)

codium

VS Code without telemetry

zed

Modern collaborative editor

ed

POSIX line editor

ex / vi

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

rsync

Incremental sync over SSH or local

scp

One-shot SSH copy

sftp

Interactive secure FTP

ssh

Remote shell (transfer via stdin/stdout)

curl

Single-file HTTP/HTTPS/FTP fetch

wget

Recursive HTTP/FTP download

aria2c

Multi-source / multi-protocol downloader

croc

Encrypted host-to-host file transfer

magic-wormhole

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

tar

Universal Unix archive (combine with a compressor)

gzip / gunzip / zcat

Single-file gzip compression

bzip2 / bunzip2 / bzcat

bzip2 compression

xz / unxz / xzcat

xz / LZMA compression

zstd / unzstd / zstdcat

Modern fast / good-ratio compressor

lz4

Very fast compressor for high-throughput

zip / unzip

Cross-platform ZIP archives

7z

7-Zip; multi-format with strong compression

cpio

Legacy archive (initramfs, RPM)

ar

Static-library archive (.a)

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

df

Free space per mounted filesystem

du

Disk usage of files and directories

ncdu

Interactive du TUI

dust

du with bar charts

lsblk

Block devices and mountpoints (tree view)

blkid

UUIDs and filesystem types

findmnt

Mount tree

smartctl

SMART data (smartmontools)

fstrim

Discard unused blocks on SSDs

mount / umount

Attach / detach filesystems

parted

GPT/MBR partition editor

fdisk / gdisk

Classic / GPT-only partition editor

mkfs.*

Create a filesystem on a device

tune2fs

Adjust ext2/3/4 parameters

resize2fs

Grow / shrink an ext filesystem

xfs_growfs

Grow an XFS filesystem

cryptsetup

Manage LUKS-encrypted volumes

mdadm

Software RAID

lvm

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

docker

The original container CLI / daemon

podman

Daemonless, rootless drop-in for Docker

containerd

The runtime under Docker / Kubernetes

nerdctl

Docker-compatible CLI for containerd

buildah

OCI image builder (Podman family)

skopeo

Image transfer / inspection across registries

runc

Low-level OCI runtime

crun

Lightweight C OCI runtime

lxc / lxd

System containers

kubectl

Kubernetes CLI

minikube

Local Kubernetes cluster

kind

Kubernetes in Docker

k3d

k3s in Docker

helm

Kubernetes package manager

docker compose

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

git

The ubiquitous DVCS

tig

TUI for Git history

lazygit

TUI for Git operations

gh

GitHub CLI

glab

GitLab CLI

gitk

Repository browser (Tk GUI)

git-lfs

Large File Storage extension

svn

Apache Subversion (legacy)

hg

Mercurial

fossil

Self-contained DVCS + bug tracker

bzr / brz

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

uname

Kernel name, version, architecture

hostnamectl

Hostname, OS, kernel, virtualization

lsb_release

Distribution release info

lscpu

CPU details

lsmem

Memory details

lspci

PCI devices

lsusb

USB devices

lshw

Comprehensive hardware listing

dmidecode

Hardware (BIOS / DMI tables)

inxi

Friendly summary report

neofetch / fastfetch

Terminal-art system summary

free

Memory summary

nproc

CPU count

getconf

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; see bash § INVOCATION and zsh § 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.

  • Git, Network, Docker, kubectl for command quick-references.

  • Bash, Vim, Tmux, Git for keybinding cheats.

  • Bash for common Bash one-liners.

  • Signals and Exit Codes, Filesystems for reference tables.

  • XDG Base Directory Specification

  • Helix book

  • Pro Git book

  • Docker docs

  • Podman docs

  • Kubernetes docs