keytool Command Examples in Linux: Complete Cheat Sheet
keytool is the Java CLI for keystores and truststores: generate key pairs, build CSRs, import CA-signed certificates and PKCS12 bundles, list aliases, export PEM certs, and manage passwords. This cheat sheet covers …
OpenSSL Command Cheat Sheet: Keys, Certificates, TLS & PKCS#12
OpenSSL is the standard CLI for TLS keys, X.509 certificates, CSRs, chain verification, PKCS#12 bundles, file encryption, and live HTTPS inspection. This cheat sheet covers everyday subcommands with copy-paste tables and …
APT Rollback and History on Ubuntu/Debian: Undo Package Changes
APT on Debian and Ubuntu does not offer a single yum-style history undo. This page covers reading /var/log/apt/history.log, downgrading with apt install package=version, holding packages, and when to use snapshots …
df and du Commands in Linux: Disk Space Syntax, Options & Examples
df reports free and used space on mounted file systems. du walks directories and sums how much disk space files and folders consume — use df for mount points, du to find what is filling a path.
dig and host Commands in Linux: DNS Lookup Syntax, Options & Examples
dig and host query DNS name servers from the command line. dig exposes full resolver control and sectioned output; host prints concise answers for quick forward and reverse lookups.
gzip Command in Linux: Compress, Decompress, and Inspect .gz Files
gzip compresses single files with the DEFLATE algorithm, replacing each source with a .gz file by default. gunzip and zcat decompress; use -k to keep originals, -c to write to stdout, and -r for directory trees.
hostnamectl Command in Linux: Syntax, Options & Practical Examples (systemd)
On systemd-based Linux, hostnamectl queries and changes the static, transient, and pretty hostnames plus chassis, icon, deployment, and location metadata. It talks to systemd-hostnamed and updates /etc/hostname where …
kill and pkill Commands in Linux: Syntax, Options & Signal Examples
kill sends a signal to a process when you know its PID; pkill matches processes by name or command line and signals them in bulk. Together they are the standard way to stop runaway jobs, reload daemons, or end test …
lsblk Command in Linux: Syntax, Options & Practical Examples (Block Devices)
lsblk lists block devices — disks, partitions, LVM volumes, and loop devices — in a tree with sizes and mount points. Use it before partitioning, mounting, or resizing storage when you need a quick map of what lives on …
systemctl Command in Linux: Syntax, Options & Practical Examples (systemd)
systemctl is the main control tool for systemd on modern Linux. It lists units, shows service status, reads unit files, and starts or stops daemons — the first command to reach for when a service misbehaves or you need …
timedatectl Command in Linux: Syntax, Options & Practical Examples (systemd)
timedatectl reads and sets the system clock, time zone, NTP synchronization, and RTC mode on systemd-based Linux. It talks to systemd-timedated and systemd-timesyncd for status and one-line changes without hand-editing …
ufw Command in Linux: Syntax, Options & Firewall Examples (Ubuntu/Debian)
ufw (Uncomplicated Firewall) is the default host firewall front end on Ubuntu and Debian. It wraps iptables/nftables with simple allow, deny, and limit rules for ports, subnets, and applications.
firewalld Cheat Sheet: firewall-cmd Rules, Commands and Examples (RHEL/Fedora)
On RHEL, Rocky Linux, AlmaLinux, and Fedora, firewalld manages host firewall rules through zones and services. The firewall-cmd CLI opens ports, assigns interfaces to zones, and applies rich rules without restarting the …
pacman Command in Arch Linux: Syntax, Options & Practical Examples
On Arch Linux and derivatives, pacman is the native package manager. It syncs official repositories, installs and removes packages with dependency tracking, and maintains a local package database under /var/lib/pacman/.
grep Pattern Matching in Linux: Regex, -E, -P, -f, and Context Lines
Match lines with extended and Perl regex, pattern files, whole words, and context lines on files or stdin. This page covers pattern engines and line-level matching — not recursive directory walks.
mke2fs Command in Linux: Syntax, Options & ext Filesystem Examples
mke2fs builds ext2, ext3, or ext4 filesystems on a block device or image file. It is the low-level formatter behind mkfs.ext4 and writes the superblock, inode tables, journal, and default mount metadata for …
losetup Command in Linux: Syntax, Options & Loop Device Examples
losetup attaches regular files or block devices to /dev/loop* kernel nodes so you can partition, format, and mount disk images without dedicated hardware. It also lists, resizes, and detaches loop devices from the shell.
mdadm Command in Linux: Syntax, Options & Software RAID Examples
mdadm assembles, creates, monitors, and stops Linux MD RAID devices (md arrays) from partitions or whole disks. It writes version 1.2 metadata superblocks, reports array health, and integrates with /etc/mdadm/mdadm.conf …
pvcreate Command in Linux: Syntax, Options & Physical Volume Examples
pvcreate writes the LVM label and metadata on a disk or partition so it can join a volume group. Use it on empty block devices before vgcreate or vgextend.
vgcfgrestore Command in Linux: Recover LVM Metadata From Archive
vgcfgrestore rebuilds volume group metadata from text backups created by LVM — usually under /etc/lvm/archive and /etc/lvm/backup. It recovers mistyped lvremove or vgcfg changes; it does not replace disk imaging when …
lvscan Command in Linux: Syntax, Options & Scan Logical Volumes
lvscan lists logical volumes on the host with activation state, device path, size, and allocation policy. Use it for a quick inventory before lvdisplay or lvs.
lvdisplay Command in Linux: Syntax, Options & Show LV Details
lvdisplay prints detailed logical volume fields — path, UUID, size, extents, allocation, snapshot status, and device-mapper block major:minor. Use it when lvs is not enough.
lvreduce Command in Linux: Shrink Logical Volumes Safely
lvreduce returns free extents from a logical volume to the volume group. Shrink the filesystem first on ext4 — data in the removed region is destroyed. Root LV shrink requires offline maintenance.
lvrename Command in Linux: Rename Logical Volumes Safely
lvrename changes the name of a logical volume inside a volume group. The LV UUID and data stay the same — update fstab, boot loaders, and refresh device-mapper after renaming root or data volumes.
lvremove Command in Linux: Syntax, Options & Remove Logical Volumes
lvremove deletes logical volumes from a volume group and frees their extents. Unmount filesystems first — active or open LVs block removal unless you force.
lvchange Command in Linux: Syntax, Options & Change LV Attributes
lvchange activates or deactivates logical volumes and updates runtime attributes — read-only access, contiguous allocation, readahead, and metadata refresh after renames.
vgcreate Command in Linux: Syntax, Options & Volume Group Examples
vgcreate groups one or more physical volumes into a volume group — the storage pool from which logical volumes are allocated. It can initialize PVs automatically if they are not already labeled.
lvcreate Command in Linux: Syntax, Options & Logical Volume Examples
lvcreate allocates logical volumes from free extents in a volume group. Create linear volumes, snapshots, and size-by-percentage LVs before you mkfs and mount.
parted Command in Linux: Syntax, Options & Partition Examples
parted creates and edits partition tables on disks and loop images — GPT or msdos labels, primary and logical partitions, resize, flags, and scripted one-liners. It is the GNU replacement for classic fdisk on large disks …
DNF Command in Linux: Syntax, Options & Practical Examples (RHEL/Fedora)
On RHEL 8+, Fedora, Rocky Linux, and AlmaLinux, dnf is the default RPM package manager. It installs and removes software from repositories, resolves dependencies with libsolv, and keeps a transaction history you can …






