LVM Snapshots Are Not Version Control

lvm linux

An LVM snapshot is not a backup, and calling it “version control” is the part of this page most likely to cost you data. A classic (non-thin) LVM snapshot lives in the same volume group as the volume it snapshots, shares its fate if that volume group’s storage fails, and — this is the part … Read more

How to Use Rsync for Backups and File Syncing in Linux

backup files using rsync on linux

For a nightly incremental backup, use this: rsync -a –delete –link-dest=/backup/previous /source/directory/ /backup/2026-08-09/ Please read this first. Do not build a backup on –ignore-existing: rsync -av –ignore-existing /source/directory/ /backup/directory/ skips updating files that already exist at the destination, so modified files are never transferred. If you built a nightly job from that command, your backup … Read more

NFS vs. Samba: Linux File Sharing Explained

learn about linux file sharing using NFS and SAMBA

Choose on authentication, not throughput. Samba joined to a domain authenticates the user — Kerberos or NTLMv2, per connection. NFS with sec=sys, the default, authenticates the host, and only by source port. If your clients are machines you fully control on a segment you fully control, NFS is simpler and defensible; for anything else, use … Read more

inotify on Linux: The Watch Limits That Make It Miss Events

real time monitoring and notifications with inotify on linux

The working form first, since this page is otherwise all warnings. Use an explicit –format with a separator that cannot appear in the event field, with the path last, and parse it with IFS= and read -r so filenames survive intact: inotifywait -m -r -e create,modify,delete,move –format ‘%e|%w%f’ /path | while IFS=’|’ read -r event … Read more

xargs Without -0 Deletes the Wrong Files

bulk file operations in linux with xargs and parallel

Always pipe find -print0 into xargs -0. Without it, xargs splits its input on spaces, tabs and newlines, so one file called my report.log arrives at rm as two arguments — my and report.log. Here is that happening. Three files go in; watch which one survives: $ ls -1 my my report.log report.log $ find … Read more

Linux `Find` Command Tutorial with Examples

Linux terminal running file management commands

The form you want almost every time is find /path -type f -name ‘*.txt’: starting directory first, then the tests, pattern quoted so the shell cannot expand it first. Outputs below come from macOS 26.6 with BSD find; GNU find on Linux differs in -regextype, -size rounding and -O (cited from GNU find(1), not tested). … Read more

dd Command: Identify the Disk Before You Copy

Linux terminal session

Before you type of=, confirm the device name with diskutil list (macOS) or lsblk (Linux) — never guess from memory. A wrong of= silently overwrites another drive with no confirmation prompt. Everything else on this page is demonstrated on scratch files, not devices. Identify the device first On macOS there is no /dev/sda at all … Read more

How to Run and Debug Bash Scripts on Linux

how to run a bash script

To run a Bash script: make it executable with chmod +x script.sh, then run it with ./script.sh, or skip the chmod and run bash script.sh directly. This page covers execution, permissions, arguments, cron scheduling, and debugging; for how to write the script itself, see how to write a bash script. You’ll need a Linux, macOS, … Read more

The Ultimate Guide to GPU Overclocking on Linux: NVIDIA, AMD

overclock gpu on linux

To overclock a GPU on Linux, you use a different interface for NVIDIA and for AMD. On NVIDIA under X11, enable the Coolbits option and set clock offsets with nvidia-settings; nvidia-smi sets power limits and locks clocks in any session. On AMD, enable the overdrive bit with the amdgpu.ppfeaturemask kernel parameter, then write to pp_od_clk_voltage … Read more

Monitor GPU Usage on Linux: nvidia-smi and sysfs

linux check gpu

On NVIDIA, the command that logs rather than glances is nvidia-smi –query-gpu=timestamp,utilization.gpu,utilization.memory,memory.used,temperature.gpu –format=csv -l 1. On AMD you do not need a tool at all — the driver publishes the numbers in sysfs: cat /sys/class/drm/card0/device/gpu_busy_percent. Before you act on either number, know what it counts, because it is not “how much of the GPU is … Read more