Linux
Articles in the Linux category (1).
Articles in this category.
- Add and remove a PPA repository on Ubuntu — Add, remove and inspect PPA APT repositories on Ubuntu and derivatives.
- Alma
- APT pinning: mixing stable, testing and backports — Configure APT pin priorities to install selected packages from testing or backports while staying on stable.
- Archlinux
- Arch Linux
- Back up a Raspberry Pi SD card over SSH with dd — Create a compressed raw image of a Raspberry Pi SD card over SSH with dd, and restore it to a card.
- Bash keyboard shortcuts and command history — Bash keyboard shortcuts for editing the command line, searching the history, managing processes and using ! history expansion.
- BorgBackup to a Synology NAS over SSH — Borg command cheat sheet to back up, list, prune and search archives on a Synology NAS.
- Centos
- Change the default editor to vim (systemctl edit, sudo) — Three ways to make systemctl edit and other tools use vim as the default editor.
- Chroot into an installed Linux system from a live USB — Mount an installed Linux system from a live USB, prepare the mounts, enter the chroot, fix the locale and reinstall GRUB.
- Cleaning Arch Linux: orphan packages, caches and logs — Housekeeping steps for an Arch Linux system: pacman cache with paccache, orphan packages, user caches, duplicates with rmlint, disk usage and the systemd journal.
- curl: useful commands (headers, download, certificate) — Headers, downloads, HTTPS target host override and certificate inspection with curl.
- Disable and enable IPv6 on Linux — Disable IPv6 at runtime through /proc for one or all interfaces, and how IPv4-mapped listening behaves.
- Encrypt a directory with eCryptfs on Linux — Interactive and non-interactive eCryptfs mounts on a directory, unmounting, and a pointer to LUKS.
- Find the last boot and shutdown on Linux — Using last, who, ausearch and the systemd journal to date the last boot and tell a graceful stop from an ungraceful one.
- Fix an APT installation blocked by dependency conflicts — Steps to unblock apt when packages stay held back or have unresolved dependency conflicts.
- Get a file's owner and group on Linux — Use ls -l and stat to display a file's owner and group.
- Growing a KVM virtual machine disk with LVM and ext4 — Procedure to grow a QEMU/KVM guest disk image, then the partition, the LVM volumes and the ext4 file systems.
- Install and remove the linux-lts kernel on Arch Linux — Add the linux-lts LTS kernel to Arch Linux with GRUB, then remove it and regenerate the boot loader configuration.
- Linux command-line cheat sheet: find, du, grep, lsof, signals and archives — Linux command-line recipes: zombie processes and signals, lsof, copying, deleting and measuring files with find and du, grep, tar, zip.
- Linux: list scheduled jobs (cron, at, timers) and check logrotate — Where to find cron, at, anacron and systemd timer jobs on a Linux server, and how to check logrotate.
- Linux login history with w, last and lastb — Where Linux stores logins (wtmp, utmp, btmp) and how to read them with w, last and lastb.
- Linux: replacing net-tools with iproute2 — Mapping from the deprecated net-tools commands (ifconfig, route, arp, netstat) to their iproute2 equivalents (ip, ss) on Linux.
- Linux users and groups: create, lock, remove — Commands and files to create, lock, age, audit and remove Linux user accounts and groups.
- List a user's sessions and kill them (Linux, AIX) — ps, pgrep, pkill, who and ss commands to list and terminate a user's processes and SSH connections.
- Lnx Network
- LVM cheat sheet: physical volumes, volume groups and logical volumes — Common Linux LVM commands: create, extend, reduce, mirrors, snapshots, configuration backup and recovery scenarios.
- Monitor processes with top, iotop and pidstat — Read the CPU fields of top, its shortcuts, filter by command line and measure I/O per process with iotop and pidstat.
- Nginx: monitoring with stub_status — Enable and test the nginx stub_status endpoint, and count client IPs from journalctl.
- NTP time synchronisation on Linux and Windows — Commands to check, test and force clock synchronisation with ntpd, chrony, systemd-timesyncd and w32time.
- pCloud on Linux: removal and backup with rclone and borg — Remove the pCloud client, back up the account with rclone then borg, and mount it with rclone.
- Performance Tools
- Query packages with apt and dpkg (Debian) — apt, apt-cache and dpkg commands to list, search, describe and locate Debian packages.
- Ranger terminal file manager: settings and shortcuts — rc.conf settings and shortcut cheat sheet for ranger.
- Read boot messages and hardware state on Linux — Read boot logs (boot, journalctl, dmesg) and inventory the hardware detected by the kernel.
- Redhat
- Reinstall an older package version with yum — Archive repositories by distribution, yum commands to go back to an earlier version, and the exclude directive to block an update.
- Remove the virbr0 and lxcbr0 interfaces (libvirt, LXC) — Disable libvirt and remove the virbr0 and lxcbr0 network bridges on RHEL/CentOS.
- Reset a garbled Linux terminal — Restore a terminal after binary output using reset, stty sane and tput.
- Roll back and pin a package version with yum (RHEL 8) — List available versions with yum, install a specific version and lock it with the versionlock plugin on RHEL 8.
- Run commands as another user and configure passwordless sudo — Using sudo and su to switch users, and configuring NOPASSWD in sudoers.
- Send the same command to all tmux panes — Turn on tmux pane synchronization to type the same command in every pane of a window.
- Set a static IP address on CentOS or RHEL — Configure a static IPv4 address, gateway and DNS servers in the ifcfg file of a CentOS or RHEL interface, then restart networking.
- Swappiness
- Tracing system calls with strace — Use strace to trace a program's file access and network calls, and save a timestamped trace to a log file.
- Ubuntu: remove old kernels, swappiness and journal size — Free space in /boot, tune swappiness and cap the systemd journal size on Ubuntu.
- Understanding and managing the Linux OOM killer — Find the processes the kernel killed for lack of memory, read and adjust their OOM score, and choose the allocation behaviour.
- Work around a flaky USB/SD disk: usb-storage and sdhci quirks — Disable UAS for a USB disk with usb-storage.quirks and reload sdhci with a quirk flag.
- Xfce keyboard shortcuts reference — Reference of the default Xfce keyboard shortcuts for windows and workspaces, and how to disable F11 in xfce-terminal.
- yum: repositories, EPEL and common commands — yum cheat sheet for RHEL/CentOS: EPEL, CentOS 8 vault, updates, cache and metadata troubleshooting.