All tags
Start here · linuxTmux for beginners, sessions, windows and panes that survive a dropped connection18 steps · 21 min read · Beginners on the Linux command lineStart the guide linux
Narrow down
Guides11
- GuideFind out why a Linux service failed, with journalctl12 steps · 13 min read
- Guidedig for beginners, look up DNS records and read the answer13 steps · 8 min read
- GuideTest the real speed of your home network with iperf36 steps · 6 min read
- GuideTmux for beginners, sessions, windows and panes that survive a dropped connection18 steps · 21 min read
- GuideSet up SSH keys and a ~/.ssh/config so you can type ssh nas and nothing elseReplace password logins with SSH keys and a ~/.ssh/config file, so ssh nas is all you type, and avoid the one trap that locks you out of your own server.7 steps · 4 min read
- GuidePut your VPS and its websites on your home network with Tailscale, and close everything except 80 and 443Put a VPS on your tailnet, move SSH and admin panels onto Tailscale, and leave only ports 80 and 443 open so the websites stay public and everything else is private.6 steps · 8 min read
- GuideReplace a cron job with a systemd timer, and see when it runs nextReplace a cron job with a systemd timer, so you can ask the machine when the job runs next and what it said the last time.6 steps · 4 min read
- GuideInstall Pi-hole on Ubuntu, with the script or with Docker ComposeInstall Pi-hole v6 on an Ubuntu machine as a network-wide ad blocker, either with the official script or with Docker Compose.4 steps · 4 min read
- GuideStop Docker container logs from eating your diskFind the container whose log is eating your disk and set a size limit on Docker's default logging, in about ten minutes.6 steps · 4 min read
- GuideFix your WordPress file permissions without breaking the siteCheck and fix your WordPress file permissions (755 for directories, 644 for files, a tighter wp-config.php) without locking yourself out.6 steps · 5 min read
- Guide🐳Guide: Updating Docker Containers via the Unraid TerminalUpdate a Docker container such as Jellyfin from the Unraid terminal, step by step, and learn why the command line gives you more control than the Update button.9 steps · 3 min read
Shell429
- Tip
cat config.yml | xsel -ibXsel -ib and xsel -ob move text between a Linux terminal and the clipboardCopy command output to the desktop clipboard and paste it back from the terminal.3 Dec 2026 - Tip
timedatectl timesync-statustimedatectl timesync-status shows which server your clock syncs withSee the NTP server, offset and poll interval of systemd-timesyncd3 Dec 2026 - Tip
[Service]TimeoutStopSec= decides how long systemd waits before it kills a serviceSets how long a service gets to stop after SIGTERM before systemd sends SIGKILL.3 Dec 2026 - Tip
sudo mkdir -p /etc/systemd/system/service.d/etc/systemd/system/service.d/ gives every service the same settingA type-level drop-in folder applies one setting to all units of a type.3 Dec 2026 - Tip
[Service]RuntimeMaxSec= stops a systemd service that runs longer than it shouldTerminates a service and marks it failed when it exceeds a maximum run time.3 Dec 2026 - Tip
printf 'hunter2' | sudo systemd-creds encrypt --name=dbpass - dbpass.credsystemd-creds encrypt keeps a service secret encrypted on diskEncrypts a secret into a file that only systemd can decrypt for a named credential.3 Dec 2026 - Tip
systemd-analyze timespan 1h30minsystemd-analyze timespan turns 1h30min into plain microsecondsParses a time span like the ones in unit files and prints it normalized.3 Dec 2026 - Tip
sudo apt-mark minimize-manualapt-mark minimize-manual marks metapackage dependencies as automaticLets apt autoremove clean up dependencies of metapackages that were once marked manual.3 Dec 2026 - Tip
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.confA Linux subnet router needs IP forwarding turned on firstEnables IP forwarding for a Linux subnet router and shows how to advertise the routes.3 Dec 2026 - Tip
SetEnv PROJECT_ENV=stagingSsh SetEnv sends a variable to the server, if AcceptEnv allows itSets an environment variable in the remote session straight from your ssh config.3 Dec 2026 - Tip
Match User tunnelSshd PermitOpen limits where a user can forward ports toRestricts SSH port forwarding to a short list of host:port destinations for a user.3 Dec 2026 - Tip
sudo dumpe2fs -h /dev/sdb1dumpe2fs -h prints the ext4 superblock without the long group listShows the settings stored in an ext4 filesystem, such as features, state and block size, in one short screen.3 Dec 2026 - Tip
sudo e2freefrag /dev/sdb1e2freefrag shows how chopped up the free space on an ext4 disk isReports free space fragmentation on ext2, ext3 and ext4, with a histogram of free chunk sizes.3 Dec 2026 - Tip
UUID=1234-abcd /mnt/backup ext4 defaults,nofail,x-systemd.device-timeout=5s 0 2Nofail in fstab lets Linux finish booting when an extra disk is missingMarks an fstab mount as optional, so a missing disk no longer holds up the boot.3 Dec 2026 - Tip
sudo grub-reboot MENU_ENTRYgrub-reboot picks a GRUB entry for the next boot onlySets which GRUB menu entry boots once, and the normal default returns after that.3 Dec 2026 - Tip
sudo bootctl set-oneshot IDBootctl set-oneshot boots another systemd-boot entry onceLists systemd-boot entries with bootctl list and picks one for the next boot only.3 Dec 2026 - Tip
systemd.unit=rescue.targetSystemd.unit=rescue.target on the kernel command line boots into a rescue shellAdds one option to the kernel command line for a single boot, to land in rescue or emergency mode.3 Dec 2026 - Tip
sudo swapon -p 10 /swap-fastSwapon -p decides which swap area Linux fills firstSets a priority per swap area, so a fast one is used before a slow one.3 Dec 2026 - Tip
sudo hdparm -I /dev/sdaHdparm -I reads the identify data straight from a driveAsks the drive itself for detailed identification and feature data, not the kernel's boot-time copy.2 Dec 2026 - Tip
sudo iftop -n -P -i eth0Iftop -n -P shows which connections use your bandwidthShows live traffic per connection on an interface, with numeric hosts and ports.2 Dec 2026 - Tip
sudo dmidecode -s bios-versionDmidecode -s prints one hardware value, like the BIOS versionPrints a single DMI string such as BIOS version or product name, handy in scripts.2 Dec 2026 - Tip
less -i /var/log/syslogless -i ignores case in searches unless your pattern has a capital letterMakes searches in less case-insensitive, except when you type a capital letter.2 Dec 2026 - Tip
sudo ufw show rawUfw show raw prints the complete firewall as iptables rulesShows everything ufw has actually loaded, which is handy when a rule does not behave as expected.2 Dec 2026 - Tip
sudo ufw allow to 224.0.0.0/24 from 10.0.0.1 proto vrrpLet keepalived talk through ufw with proto vrrpKeepalived uses VRRP, protocol 112, which ufw only accepts in the full rule syntax.2 Dec 2026 - Tip
watch -c ls --color=always -l /var/logwatch -c keeps the colors that a command printsShow colored output in watch instead of plain or garbled text.1 Dec 2026 - Tip
uname -r | wl-copywl-copy is the clipboard command for a Wayland desktopPipe text to the clipboard and paste it back on Wayland.1 Dec 2026 - Tip
sudo snap save lxdSnap save makes a snapshot of a snap's data before you try something riskyKeep a restorable copy of an app's data and settings.1 Dec 2026 - Tip
sudo snap stop --disable lxd.daemonSnap can stop a service and keep it from coming back after bootTurn off a background service while the app itself stays installed.1 Dec 2026 - Tip
sudo snap alias vlc my-vlcSnap alias gives a snap command the name you want to typeCreate your own command name for an app installed as a snap.1 Dec 2026 - Tip
sudo systemctl daemon-reloadSystemctl daemon-reload comes after every unit file you edit by handLoad unit file changes before you restart the service.1 Dec 2026 - Tip
systemctl list-units --type=service --state=runningsystemctl list-units can show only what is running right nowGet a clean list of what is active on a machine right now.1 Dec 2026 - Tip
systemctl -H [email protected] status nginxsystemctl -H manages services on another machine over SSHCheck or restart a remote service without opening a shell there first.1 Dec 2026 - Tip
sudo systemctl reboot --firmware-setupSystemctl reboot can take you straight into the UEFI setup menuSkip the key mashing at startup when you need the firmware settings.1 Dec 2026 - Tip
systemctl list-jobssystemctl list-jobs shows what a slow start or shutdown is waiting forSee which unit jobs are queued or running when things seem stuck.1 Dec 2026 - Tip
sudo systemctl try-restart nginx.serviceSystemctl try-restart only restarts a service that is already runningApply an update in a script without starting services you had stopped.1 Dec 2026 - Tip
sudo systemctl freeze indexer.serviceSystemctl freeze pauses a service and thaw lets it continueSuspend a busy service for a moment without stopping it.1 Dec 2026 - Tip
sudo apt install vnstatVnstat keeps a traffic history for monitoring your monthly usageSee how much data a network interface moved per day or month.1 Dec 2026 - Tip
sudo apt install sysstatSar reads back your monitoring data from earlier today or yesterdayCheck load and memory at the time a problem happened, after the fact.1 Dec 2026 - Tip
sudo apt install nethogsNethogs adds per program network monitoring to your toolboxFind which process is using the bandwidth right now.1 Dec 2026 - Tip
sudo apt install fioFio measures the random read performance of a disk with a test fileTest small random reads, which feel closer to real use than big copies.1 Dec 2026 - Tip
sudo dmesg -CDmesg -C empties the kernel buffer so a test starts from nothingClear old messages, reproduce a problem and read only what it produced.1 Dec 2026 - Tip
sudo dmesg -xDmesg -x labels every line with its facility and levelSee how serious each kernel message is, right in front of the line.1 Dec 2026 - Tip
sudo dmesg -r > kernel.rawDmesg -F reads a saved kernel log from a file, with the usual filtersSave raw kernel messages on one machine and study them on another.1 Dec 2026 - Tip
sudo lshw -shortLshw -short gives a one page overview of the hardware inside a PCList the machine's parts with their device names in one table.1 Dec 2026 - Tip
sudo apt install smemSmem shows the fair share of shared memory that each process usesGet per process and per user memory numbers that add up sensibly.1 Dec 2026 - Tip
sudo pmap -x 1234Pmap -x breaks the memory of one process down by mappingSee whether a big process is heap, libraries or mapped files.1 Dec 2026 - Tip
sudo systemctl edit indexer.serviceMemoryHigh= squeezes a hungry service's memory before anything is killedSlow a greedy service down and reclaim its memory at a soft limit.1 Dec 2026 - Tip
sudo fsfreeze -f /srv/dataFsfreeze holds back writes on filesystems while you take a snapshotFlush and pause a mounted volume so a disk snapshot is consistent.1 Dec 2026 - Tip
sudo smartctl -q silent -a /dev/sdaSmartctl returns a bitmask, so a script can read smart trouble from $?Decodes the smartctl exit status so your script knows what went wrong.1 Dec 2026 - Tip
sudo smartctl -l devstat /dev/sdaSmartctl -l devstat prints standard smart statistics with readable namesShows device statistics with plain descriptions instead of vendor attribute numbers.1 Dec 2026 - Tip
sudo smartctl -l scttemphist /dev/sdaSmartctl -l scttemphist shows the smart temperature history a drive keepsReads the temperature graph the drive recorded itself, even without monitoring software.1 Dec 2026 - Tip
sudo smartctl -t select,1000000-2000000 /dev/sdaSmartctl -t select runs a smart self-test on just one range of sectorsTests only a suspicious area of a disk instead of the whole surface.1 Dec 2026 - Tip
sudo smartctl -l sataphy /dev/sdaSmartctl -l sataphy counts smart link errors between drive and controllerHelps separate a bad cable or port from a bad disk.1 Dec 2026 - Tip
file photo.jpg data.binfile reads the contents to tell you what files really areIdentify a file by its contents, whatever its extension claims.1 Dec 2026 - Tip
systemctl list-unit-files --state=enabledsystemctl list-unit-files with a state filter lists what systemd starts at bootGet a clean list of every enabled unit, or every masked or disabled one.30 Nov 2026 - Tip
echo 'systemctl restart myapp' | at 03:00 tomorrowAt runs a job once, where cron would repeat itSchedules a single command for later without adding a cron line you have to remember to delete.30 Nov 2026 - Tip
grep -l 'TODO' *.py | xargs -o vimXargs -o lets an interactive program like vim work from a pipeConnects the command xargs starts to your terminal, so editors and prompts work normally.30 Nov 2026 - Tip
[Service]StateDirectory= gives a systemd service its own folder under /var/libLet systemd create and own the data folder of a service, with the right user.30 Nov 2026 - Tip
sudo systemd-analyze log-level debugsystemd-analyze log-level debug makes systemd itself log in detailTurn on debug logging for the service manager at runtime, without a reboot.30 Nov 2026 - Tip
[Service]A minus in front of a systemd ExecStartPre= command ignores its failureLet an optional preparation step fail without stopping the service from starting.30 Nov 2026 - Tip
55 23 28-31 * * [ "$(date -d tomorrow +\%d)" = 01 ] && /usr/local/bin/month-end.shCron has no last day of the month, but a date check gives you oneRuns a cron job on the last day of every month, whatever its length.30 Nov 2026 - Tip
systemctl list-socketssystemctl list-sockets shows which port starts which systemd serviceSee every socket systemd listens on and the service each one would start.30 Nov 2026 - Tip
journalctl -k -g 'killed process' --since "2 days ago"journalctl -k -g finds which process the OOM killer tookFind out which program the kernel killed when memory ran out.30 Nov 2026 - Tip
grep -E ' (install|upgrade|remove) ' /var/log/dpkg.log | tail/var/log/dpkg.log records every package change, even ones apt did not makeLists each install, upgrade and removal at dpkg level with versions and times.30 Nov 2026 - Tip
journalctl _PID=1 -bjournalctl _PID=1 shows only what systemd itself saidRead the service manager's own messages about starts, stops and failures without the services' chatter.30 Nov 2026 - Tip
sudo su -s /bin/bash www-datasu -s /bin/bash www-data tests permissions as a user that has no login shellOpens a shell as a service account to try file access step by step.30 Nov 2026 - Tip
grep -vxFf allowed.txt users.txtgrep -vxFf shows which lines of one list are missing from anotherCompare two lists without sorting them first, line for line and exact.30 Nov 2026 - Tip
ls -lh /var/log/journal/*/*.journal~Journalctl still reads the .journal~ files that journald set asideUnderstand the journal files with a tilde at the end and read them when needed.30 Nov 2026 - Tip
sudo apt-get -d -y full-upgradeapt-get -d upgrade downloads everything first, so the real upgrade is quickFetches all upgrade packages ahead of time without installing anything.30 Nov 2026 - Tip
EDITOR=nano crontab -eVISUAL or EDITOR decides which editor crontab -e opensPicks the editor for crontab -e for one command or for good.30 Nov 2026 - Tip
30 6 * * mon /usr/local/bin/weekly-report.shCron accepts mon and jan, and both 0 and 7 mean SundayMakes crontab lines easier to read with day and month names, and explains the two Sundays.30 Nov 2026 - Tip
Storage=volatileStorage=volatile keeps the journalctl log in RAM onlyStop journald from writing logs to an SD card or other fragile storage.30 Nov 2026 - Tip
systemd-analyze cat-config systemd/journald.confsystemd-analyze cat-config shows a systemd config with all its drop-insRead the full effective config of journald, logind or resolved in one place.30 Nov 2026 - Tip
sudoedit /etc/ssh/sshd_configsudoedit edits a root-owned file with your own editor settings, not as rootEdit system files safely without running a whole editor as root.30 Nov 2026 - Tip
sudo journalctl --setup-keysJournalctl setup-keys seals your logs so tampering shows upMake later changes to stored journal files detectable with a key you keep elsewhere.30 Nov 2026 - Tip
coredumpctl list --since todaycoredumpctl list shows every program that crashed on your Linux boxSee which programs crashed, when, and with which signal, all from the journal.30 Nov 2026 - Tip
sudo setfacl -R -d -m g:media:rwX /srv/mediaSetfacl -d sets default permissions that every new file in a folder inheritsMakes new files in a shared folder get the right ACL automatically.30 Nov 2026 - Tip
sudo cp -r /srv/site /srv/site.rcp -a keeps owner, group and permissions, plain cp -r does notCopies a folder while keeping its owners, modes, timestamps and links.30 Nov 2026 - Tip
sudo usermod --expiredate 1 bobUsermod -e 1 shuts an account out, SSH keys included, a real security lockDisables an account completely, so key logins stop too, without deleting anything.30 Nov 2026 - Tip
journalctl -F _KERNEL_SUBSYSTEMjournalctl _KERNEL_SUBSYSTEM=usb shows what the kernel said about USB devicesFilter kernel and udev messages to one kind of hardware, like USB or PCI.30 Nov 2026 - Tip
journalctl -t demoapp -n 1 -o json-seq | od -c | head -1journalctl -o json-seq writes records that survive a cut off streamGet JSON records with a clear start marker, so a half written line can be skipped.30 Nov 2026 - Tip
sudo mkdir -p /etc/systemd/journald.conf.dMaxRetentionSec in journald.conf caps how old journalctl history getsMake journald delete old log files after a fixed age, whatever the disk size.30 Nov 2026 - Tip
journalctl -u nginx -e -n 5000journalctl -e loads only the last 1000 lines unless you ask for moreScroll further back after jumping to the end of the journalctl pager.30 Nov 2026 - Tip
sudo systemctl edit nginx.serviceLimitNOFILE= raises the open files limit of one systemd serviceGive a busy service more file handles than the default, set in the unit itself.30 Nov 2026 - Tip
ww is the first security check when a server feels offShows who is logged in right now, from where, and what they are running.30 Nov 2026 - Tip
head -n 3 config.env | od -cOd -c shows every byte of a line, including the ones your terminal hidesFind the stray carriage return, tab or odd byte that breaks a script or config.30 Nov 2026 - Tip
sudo systemctl soft-rebootSystemctl soft-reboot restarts all of systemd userspace without the kernelRestart every service and the service manager quickly, while the kernel keeps running.30 Nov 2026 - Tip
sudo systemctl edit --drop-in=limits myapp.serviceSystemctl edit with drop-in names keeps several systemd overrides apartGive each override of a unit its own named file instead of one big override.conf.30 Nov 2026 - Tip
SYSTEMD_COLORS=1 journalctl -b -p warning | less -RSYSTEMD_COLORS=1 keeps journalctl colors when you pipe the outputKeep the red errors and yellow warnings when journalctl output goes through grep or less.30 Nov 2026 - Tip
sudo journalctl --rotateJournalctl rotate makes vacuum delete the current file tooArchive the active journal file first so a cleanup can actually remove its data.30 Nov 2026 - Tip
SYSTEMD_LESS=FRXMK journalctl -u nginxSYSTEMD_LESS changes how the journalctl pager behavesMake the journalctl pager wrap long lines instead of cutting them off at the screen edge.30 Nov 2026 - Tip
sudo systemctl edit myapp.serviceProtectHome=yes keeps a systemd service out of every home folder, a security one-linerMakes /home, /root and /run/user empty and unreachable for one service.30 Nov 2026 - Tip
[Service]SyslogIdentifier= gives a systemd service a readable name in the logReplace names like sh, python3 or java in log lines with the name of your service.30 Nov 2026 - Tip
sudo apt install aideAIDE takes a fingerprint of your system files so a security check shows what changedBuilds a database of file checksums and later reports every file that changed.30 Nov 2026 - Tip
systemd-detect-virtsystemd-detect-virt tells a script whether it runs in a VM or containerLet a script check if it is on bare metal, in a VM or inside a container.30 Nov 2026 - Tip
DNSStubListener=noDNSStubListener=no frees port 53 from systemd-resolved for Pi-holeTurn off the local stub resolver so Pi-hole or another DNS server can bind to port 53.30 Nov 2026 - Tip
[Timer]Unit= lets one systemd timer start a service with another nameTrigger any service from a timer, so two timers can share one job.30 Nov 2026 - Tip
sudo apt-get -s install chrony systemd-timesyncd-A minus after a package name lets apt-get install and remove in one goSwaps one package for another in a single apt transaction.30 Nov 2026 - Tip
journalctl -N | sortjournalctl -N lists every field name your journal usesSee which field names exist before you write a match on the journalctl command line.30 Nov 2026 - Tip
sudo systemctl clean --what=cache myapp.serviceSystemctl clean wipes the cache or state of a systemd serviceDelete a service's cache, state or log folders with one command, without guessing paths.30 Nov 2026 - Tip
sudo apt-mark auto build-essential libssl-devapt-mark auto lets apt autoremove clean up packages you no longer needMarks packages as dependencies so autoremove can remove them when nothing needs them.30 Nov 2026 - Tip
[Timer]AccuracySec= is why a systemd timer fires up to a minute lateMake a timer fire close to the exact time instead of anywhere in the next minute.30 Nov 2026 - Tip
systemd-escape -p --suffix=mount /mnt/backupA systemd .mount unit must be named after its mount pathName mount unit files correctly so systemd accepts them, using systemd-escape.30 Nov 2026 - Tip
sudo dpkg-reconfigure tzdatadpkg-reconfigure asks a package's apt install questions againReruns the setup questions of an installed package, like time zone or locale.30 Nov 2026 - Tip
sudo hdparm -C /dev/sdXHdparm -C asks a disk if it's asleep without waking itShows whether a hard disk is spinning or in standby, for checking spin down settings.30 Nov 2026 - Tip
sudo nsenter -t "$pid" -n ss -tlnpNsenter runs host tools inside a Docker container's networkUse the host's ss, tcpdump or curl as if they ran inside a container.30 Nov 2026 - Tip
journalctl -b -1 -n 50journalctl -b -1 -n 50 shows how the last boot endedRead the final lines before a reboot or crash to see whether it was a clean shutdown.30 Nov 2026 - Tip
sudo journalctl -k --since '10 min ago' | grep 'apparmor="DENIED"'Permission denied with correct permissions often means AppArmor said noFinds AppArmor denials in the kernel log when chmod and chown look right.30 Nov 2026 - Tip
sudo systemctl edit myapp.serviceUMask= in a systemd unit sets the permissions of every file a service createsControls the default mode of new files written by one service.30 Nov 2026 - Tip
watch -n 1 "grep -E '^(Dirty|Writeback):' /proc/meminfo"Dirty and Writeback in /proc/meminfo show how much data Linux still has to write to diskKnow when a copy has really reached the disk before you pull a USB drive.30 Nov 2026 - Tip
sysctl -a 2>/dev/null | grep -E 'accept_redirects|send_redirects'Turn off ICMP redirects on a server, a sysctl security setting most hosts never needStops the server from changing its routes because of ICMP redirect messages.30 Nov 2026 - Tip
[Service]ExecCondition= lets a script decide whether a systemd service runsSkip a service quietly when a check command says now is not the time.30 Nov 2026 - Tip
sudo ls -l /var/spool/cron/crontabsEvery user can have a crontab, so check them all when a cron job is a mysteryLists the personal crontabs of every account, to find a job that runs from somewhere unexpected.30 Nov 2026 - Tip
sudo apt-get -s autocleanapt-get autoclean keeps the cache but drops .deb files that are out of dateRemoves only cached package files that can no longer be downloaded.30 Nov 2026 - Tip
ethtool -S eth0 | grep -iE 'err|drop|miss|crc'ethtool -S shows the error counters that the Linux network card keeps itselfRead the card's own statistics to spot CRC errors, missed packets and other link trouble.30 Nov 2026 - Tip
sudo usermod -G users aliceUsermod -G without -a wipes a user's other group permissionsShows why adding a group always needs the append flag.30 Nov 2026 - Tip
sudo mount -o remount,hidepid=2 /procMount /proc with hidepid=2 so users only see their own processes, a security gainHides other users' processes and their command lines from normal accounts.30 Nov 2026 - Tip
journalctl -u 'php*-fpm.service' --since todayjournalctl -u takes a wildcard to read a whole family of unitsRead all instances of a template service or every matching unit in one command.30 Nov 2026 - Tip
sudo apt -o Acquire::ForceIPv4=true updateAcquire::ForceIPv4 fixes apt update when it hangs on a broken IPv6 routeMakes apt download over IPv4 only when IPv6 connections stall.30 Nov 2026 - Tip
journalctl -u nginx --since "$(systemctl show -p ActiveEnterTimestamp --value nginx)"journalctl since ActiveEnterTimestamp shows logs from the last service startRead only the log lines since a service last started, without looking up the time.30 Nov 2026 - Tip
sudo apt install libpam-pwqualityPwquality.conf sets the password rules for passwd, a security baseline in one fileMakes passwd refuse short or dictionary passwords for local accounts.30 Nov 2026 - Tip
sudo install -d -m 0755 /etc/apt/keyringsSigned-By ties an apt repository to its own key instead of trusting it for everythingLimits a third party key so it can only sign its own repository.30 Nov 2026 - Tip
awk -F: '($3 == 0) {print $1}' /etc/passwdOne awk line finds every account with UID 0, a security check worth a cron jobLists every account in /etc/passwd that has root's user ID.30 Nov 2026 - Tip
[Service]RestartSteps= makes systemd wait longer between each restartBack off gradually when a service keeps crashing instead of hammering it every few seconds.30 Nov 2026 - Tip
sudo tar --numeric-owner -cpf app.tar -C /srv appTar with numeric owners keeps file permissions right when you restore on another machineStores and restores owners by number, so a restore elsewhere gets the right owners.30 Nov 2026 - Tip
ExecReload=/bin/kill -HUP $MAINPIDExecReload= with $MAINPID gives a systemd service a working reloadMake systemctl reload send a signal to the main process of your own service.30 Nov 2026 - Tip
journalctl _TRANSPORT=stdout -u myappjournalctl _TRANSPORT=stdout shows what services printed to their terminalSeparate the lines a service printed with echo or print from its proper log calls.30 Nov 2026 - Tip
[Unit]A systemd template unit runs the same service for several namesWrite one unit file with %i and start as many named instances of it as you need.30 Nov 2026 - Tip
sudo systemctl reset-failed myapp.serviceSystemctl reset-failed clears old failures from the systemd listClean up the failed state of units so the list only shows current problems.30 Nov 2026 - Tip
sudo dmesg -wTDmesg -w shows the name a disk gets when you plug it inWatches kernel messages live, so you see the device name and any errors of a disk you connect.30 Nov 2026 - Tip
sudo systemctl edit myapp.serviceIPAddressDeny=any gives one systemd service its own firewall, a security layerLimits which IP addresses a single service may talk to, in both directions.30 Nov 2026 - Tip
sudo apt-get checkapt-get check finds broken dependencies, and apt install -f repairs themDiagnoses and fixes a package system left with unmet dependencies.30 Nov 2026 - Tip
crontab cron.txtcrontab file.txt replaces your whole crontab, it doesn't add to itExplains how installing a crontab from a file works, and how to add a line without losing the rest.30 Nov 2026 - Tip
Accept=yesAccept=yes starts one systemd service per connection, like inetdServe a tiny network service from a script, with systemd handling the socket.30 Nov 2026 - Tip
journalctl _SYSTEMD_SLICE=user-1000.slice --since todayjournalctl _SYSTEMD_SLICE= shows everything one slice loggedRead the logs of every process in one slice, such as one user's session.30 Nov 2026 - Tip
[Service]SuccessExitStatus= tells systemd which odd exit codes are fineStop a service from showing as failed when its program exits with a harmless code.30 Nov 2026 - Tip
systemd-cgls -u nginx.servicesystemd-cgls -u shows every process inside one serviceSee the full process tree of one unit, including children the main process started.30 Nov 2026 - Tip
NoNewPrivileges=yesNoNewPrivileges=yes stops a systemd service from gaining root through setuidMake sure a service and its children can never gain more rights through sudo or setuid binaries.30 Nov 2026 - Tip
PrivateTmp=yesPrivateTmp=yes gives a systemd service its own empty /tmpKeep a service's temporary files away from other users and programs.30 Nov 2026 - Tip
sudo pwck -rPwck -r checks passwd and shadow for broken entries, a read-only security checkChecks the account files for broken lines without changing a thing.30 Nov 2026 - Tip
[Timer]A time zone in OnCalendar= runs a systemd timer on another clockSchedule a timer in local office time while the server itself runs on UTC.30 Nov 2026 - Tip
PrivateDevices=yesPrivateDevices=yes hides your disks from a systemd serviceGive a service a minimal /dev without disks, so a bug can not read raw devices.30 Nov 2026 - Tip
sudo visudo -f /etc/sudoers.d/iologSudoreplay plays back sudo sessions recorded with log_output, a security review toolRecords the terminal output of sudo sessions so you can replay them later.30 Nov 2026 - Tip
systemd-delta --no-pagersystemd-delta shows every config file you or a package changedList all overridden, extended and masked systemd files on a machine in one go.30 Nov 2026 - Tip
sudo getfacl -R -p srv/data > /root/data-perms.aclGetfacl -R saves the permissions of a whole tree, and setfacl puts them backBacks up owners, modes and ACLs of a folder tree to one text file.30 Nov 2026 - Tip
systemctl show-environmentsystemctl show-environment shows the variables every systemd service starts withCheck which PATH and other variables services get, since they never read your shell profile.30 Nov 2026 - Tip
[Service]SystemCallFilter= blocks whole groups of system calls in a systemd serviceForbid a service from calling things like mount or reboot at the kernel level.30 Nov 2026 - Tip
sudo journalctl --relinquish-varJournalctl relinquish-var lets you unmount /var without losing logsMake journald stop writing to /var so the disk can be unmounted cleanly.30 Nov 2026 - Tip
sudo passwd -S -aPasswd -S -a shows the password state of every account, a quick security overviewPrints for each account whether its password is set, locked or empty.30 Nov 2026 - Tip
* * * * * env > /tmp/cron-env.txt 2>&1Let cron write its environment to a file to debug a failing jobCaptures the exact environment cron gives your jobs, so you can run a script the same way by hand.30 Nov 2026 - Tip
sudo tee /etc/systemd/journald.conf.d/50-filesize.conf <<'EOF'SystemMaxFileSize in journald.conf decides how much journalctl vacuum frees at onceControl the size of each journal file, and with it how coarse cleanups are.30 Nov 2026 - Tip
0 9-17/2 * * 1-5 /usr/local/bin/sync-orders.sh9-17/2 in a cron field runs a job every two hours, only during the dayCombines a range and a step in one cron field, for schedules limited to office hours.30 Nov 2026 - Tip
journalctl _SYSTEMD_UNIT=nginx.servicejournalctl _SYSTEMD_UNIT= skips what systemd said about the serviceShow only lines a service wrote itself, without the start and stop messages from systemd.30 Nov 2026 - Tip
journalctl MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1 -o short-isojournalctl MESSAGE_ID= lists every program that crashed with a core dumpGet a list of crashes from the journal with one fixed message ID.30 Nov 2026 - Tip
echo 'readonly TMOUT=900; export TMOUT' | sudo tee /etc/profile.d/tmout.shTMOUT logs out an idle shell, a simple security setting for shared serversEnds an interactive bash session after a set time without input.30 Nov 2026 - Tip
systemd-analyze plot > boot.svgsystemd-analyze plot draws your boot as an SVG timelineSee in one picture which units start in parallel and which ones hold up the boot.30 Nov 2026 - Tip
sudo nginx -t -c /tmp/stage/nginx.confNginx -t -c tests a new config file before it replaces the live oneChecks a staged nginx.conf for errors while the running config stays untouched.30 Nov 2026 - Tip
sudo less /var/log/apt/term.log/var/log/apt/term.log keeps the full apt output, error messages includedShows the full terminal output of past apt runs, including install script errors.30 Nov 2026 - Tip
systemctl status 4211systemctl status with a PID tells you which systemd unit owns a processFind out which service or session started a process you spotted in top.30 Nov 2026 - Tip
grep -L 'Restart=' /etc/systemd/system/*.servicegrep -L lists the files that do not contain a patternFind the config files where a setting is missing, not the ones where it is set.30 Nov 2026 - Tip
sudo aa-complain /usr/sbin/nginxaa-complain lets an AppArmor profile log instead of block while you test security rulesSwitches one AppArmor profile to logging mode, so you can see what it would block.30 Nov 2026 - Tip
xargs -a hosts.txt -n 1 ssh-keygen -Rxargs -a reads the list from a file and keeps standard input freeTakes the items from a file so the command that xargs runs can still use the keyboard.30 Nov 2026 - Tip
sudo tcpdump -i any -n -c 500 -w /tmp/capture.pcap host 192.168.1.50 and port 443Tcpdump -w saves a capture you can open in Wireshark laterRecords packets to a file with a filter and a packet limit for later analysis.28 Nov 2026 - Tip
grep ^hosts /etc/nsswitch.confThe hosts line in nsswitch.conf decides who answers firstShows the order in which Linux asks /etc/hosts, DNS and other sources for a name.28 Nov 2026 - Tip
resolvectl show-cacheresolvectl show-cache lists what systemd-resolved remembersLists the records systemd-resolved has cached, grouped by network scope.28 Nov 2026 - Tip
sudo resolvectl log-level debugResolvectl log-level debug turns on systemd-resolved debug logging without a restartRaises systemd-resolved's log level on the fly so lookups show up in the journal.28 Nov 2026 - Tip
systemd-cgtop -c -n 1systemd-cgtop is top for systemd units instead of processesShows CPU, memory and I/O use grouped per systemd unit, sorted live.28 Nov 2026 - Tip
resolvectl show-server-stateresolvectl reset-server-features makes systemd-resolved forget what it learned about a serverShows what systemd-resolved knows about each DNS server and makes it probe again.28 Nov 2026 - Tip
systemd-inhibit --why="Copying photos" rsync -a /mnt/user/photos/ /mnt/backup/photos/systemd-inhibit keeps a long job from being cut off by sleep or shutdownRuns a command while preventing the machine from sleeping or shutting down.28 Nov 2026 - Tip
sudo apt install needrestartNeedrestart tells you which services still run old libraries after an upgradeLists services that still use outdated libraries after package upgrades.28 Nov 2026 - Tip
sudo -ksudo -k forgets your cached sudo password right awayClears sudo's cached password so the next command asks for it again.28 Nov 2026 - Tip
ldconfig -p | grep libsslldconfig -p lists every shared library the system can findLists the shared libraries registered in the linker cache so you can search them.28 Nov 2026 - Tip
lslockslslocks shows which process holds a lock on which fileLists file locks held on the system with the process that owns each one.28 Nov 2026 - Tip
ssh -D 127.0.0.1:1080 [email protected]ssh -D 1080 turns an SSH connection into a SOCKS proxyStarts a local SOCKS proxy that sends your browser traffic through an SSH server.28 Nov 2026 - Tip
AddKeysToAgent yesAddKeysToAgent yes loads your key into the agent on first useMakes ssh add your private key to the agent the first time it is used.28 Nov 2026 - Tip
Include config.d/*Include in ssh config splits your hosts over several filesReads extra ssh config files from a folder, so each group of hosts gets its own file.28 Nov 2026 - Tip
ClientAliveInterval 60ClientAliveInterval lets sshd drop dead client connectionsMakes sshd check silent clients and disconnect them after a number of missed replies.28 Nov 2026 - Tip
[email protected]:~$ ~CType ~C to add a port forward to a running SSH sessionOpens ssh's own command line in a live session so you can add or cancel port forwards.28 Nov 2026 - Tip
ssh-keygen -F example.comssh-keygen -F finds a host in known_hostsSearches known_hosts for one host name and prints the entries it finds.28 Nov 2026 - Tip
shred -v -u -z ~/Documents/old-secret.txtshred overwrites a file before deleting it, but the manual has a warningOverwrites a file before deleting it, plus the manual's warning about copies and file systems.28 Nov 2026 - Tip
pinoutThe pinout command draws the Raspberry Pi GPIO header in your terminalPrints a map of the GPIO header with physical pins, GPIO numbers and functions.28 Nov 2026 - Tip
vcgencmd bootloader_versionSudo rpi-eeprom-update tells you if your Raspberry Pi bootloader is outdatedReports whether the bootloader in the Pi's EEPROM has a newer version available.28 Nov 2026 - Tip
sudo faillock --user aliceFaillock shows failed logins and clears a locked accountShows the failed logins of a user and clears the records that lock the account.28 Nov 2026 - Tip
sudo visudo -c && echo sudoers okVisudo -c checks your sudoers files for syntax errorsChecks sudoers and its included files for syntax errors and returns an exit code.28 Nov 2026 - Tip
[email protected] # alerts go hereA # comment on the same line as a crontab setting becomes part of itShows why a comment after a crontab command or variable gets treated as part of that line.28 Nov 2026 - Tip
6~15 3 * * * /usr/local/bin/sync-things.sh6~15 in a cron field picks a random minute, if your cron is cronieLets a cronie crontab pick a random minute in a range so many machines do not start at once.28 Nov 2026 - Tip
sudo apt-get satisfy "libssl-dev (>= 3.0)" "pkg-config"apt-get satisfy installs whatever a dependency string asks forInstalls packages from a dependency line with version constraints, and can remove conflicting ones.28 Nov 2026 - Tip
sudo slabtop -o -s cSlabtop -o shows which kernel cache is eating your memoryList the biggest kernel slab caches once, sorted by size, when memory goes missing.28 Nov 2026 - Tip
sudo apt-get install --only-upgrade nginxapt-get install --only-upgrade updates one package and never installs it newUpgrades a named package only if it is already installed, and never installs it as new.28 Nov 2026 - Tip
/usr/bin/time -f "%e s elapsed, %M KB peak memory" tar czf /tmp/test.tar.gz ~/Documents/usr/bin/time -f '%e s, %M KB' shows how much memory a command neededReports elapsed time and peak memory of one command with GNU time.28 Nov 2026 - Tip
sudo du -xh -d1 / | sort -hdu -x stays on one filesystem so a mounted disk does not skew the totalTotals folder sizes without crossing into other mounted filesystems.28 Nov 2026 - Tip
sudo du --inodes -x -d2 /var | sort -n | taildu --inodes shows which folder uses up all your inodesCounts files per directory instead of bytes, to find what exhausts the inodes.28 Nov 2026 - Tip
ssh-keygen -H -f ~/.ssh/known_hostsssh-keygen -H hashes the host names in known_hostsTurns the host names in known_hosts into hashes so the file no longer lists your servers.28 Nov 2026 - Tip
ssh-keygen -t ed25519 -a 100 -C "laptop"ssh-keygen -a sets how many rounds protect your key passphraseRaises the number of key derivation rounds so a stolen SSH key file is harder to brute-force.28 Nov 2026 - Tip
MaxAuthTries 3MaxAuthTries limits password guesses per SSH connectionLowers how many authentication attempts sshd allows per connection, default 6.28 Nov 2026 - Tip
MaxStartups 5:50:20MaxStartups limits unauthenticated SSH connectionsCaps unauthenticated SSH connections and shortens the login window to blunt connection floods.28 Nov 2026 - Tip
PermitRootLogin noPermitRootLogin has four values, and the default is not yesShows the four PermitRootLogin values and how to see the one your server really uses.28 Nov 2026 - Tip
sudo aa-statusaa-status shows which processes AppArmor confinesLists the loaded AppArmor profiles, their modes and how many running processes are confined.28 Nov 2026 - Tip
sudo cryptsetup luksHeaderBackup /dev/sdb1 --header-backup-file /root/sdb1-header.imgCryptsetup luksHeaderBackup saves the one part of a LUKS disk you cannot rebuildSaves the LUKS header and keyslots to a file, so a damaged header does not mean lost data.28 Nov 2026 - Tip
sudo systemctl reload-or-restart nginx.serviceSystemctl reload-or-restart reloads a service when it can and restarts when it cannotReloads a service when it supports reloading and does a full restart when it does not.28 Nov 2026 - Tip
sudo usermod -s /usr/sbin/nologin svc-backupGive service accounts the nologin shell so nobody can log in as themSets an account shell to nologin so that service users refuse interactive logins.28 Nov 2026 - Tip
sudo systemctl kill --signal=SIGHUP --kill-whom=main nginx.serviceSystemctl kill --signal sends a signal to a service's processesSends a chosen signal to the main or all processes of a unit without looking up a PID.28 Nov 2026 - Tip
IdentitiesOnly yesIdentitiesOnly yes makes ssh use only the key you configuredStops ssh from offering every key in the agent and sends only the identity file you named.28 Nov 2026 - Tip
ssh -o StrictHostKeyChecking=accept-new [email protected] uptimeStrictHostKeyChecking accept-new trusts a new server once and refuses it when its key changesLets ssh add the key of a new server without asking, but still refuses a server whose key changed.28 Nov 2026 - Tip
ssh -o VisualHostKey=yes [email protected]VisualHostKey yes draws the host key fingerprint as ASCII artPrints the server host key fingerprint as ASCII art so you can compare it by shape.28 Nov 2026 - Tip
Host *UpdateHostKeys lets a server add its other host keys to your known_hostsLets a trusted SSH server hand you its additional host keys so known_hosts stays current.28 Nov 2026 - Tip
sudo systemd-run --on-active=30 --timer-property=AccuracySec=100ms /bin/touch /tmp/foosystemd-run --on-active runs a command once after a delayCreates a one-off transient timer that starts a command after the delay you give.28 Nov 2026 - Tip
sudo systemctl revert example.serviceSystemctl revert throws away every override of a unitRemoves drop-ins and overrides of a unit so it goes back to the vendor version.28 Nov 2026 - Tip
sudo systemctl edit myapp.serviceRequiresMountsFor= makes a systemd service wait until its disk is mountedKeeps a service from starting before the disk or share it writes to is mounted.27 Nov 2026 - Tip
sudo systemctl mask --now cups.serviceSystemctl mask stops a systemd unit from starting at all, not just at bootBlocks a systemd service from being started by anything until you unmask it.27 Nov 2026 - Tip
sudo ufw resetUfw reset starts the firewall over and keeps a backup of your old rulesWipes all firewall rules back to the defaults and saves the old rule files first.27 Nov 2026 - Tip
alias sudo='sudo 'alias sudo='sudo ' with a trailing space lets your aliases work after sudoMakes sudo ll and other aliases after sudo work instead of giving command not found.27 Nov 2026 - Tip
Ctrl-Z # pause the running commandCtrl-Z pauses a running command, bg sends it to the background and fg brings it backPauses a command that blocks your terminal and lets it continue in the background.27 Nov 2026 - Tip
192.168.1.x:/export/media /mnt/media nfs x-systemd.automount,x-systemd.idle-timeout=10min 0 0x-systemd.automount in fstab mounts a NAS share on first useMounts a network share only when a program opens the folder, so boot never waits for it.27 Nov 2026 - Tip
sudo losetup -f -P -r --show sdcard.imgLosetup -P opens the partitions inside a disk imageMounts the partitions inside a full disk image file, such as an SD card backup.27 Nov 2026 - Tip
sudo mount --bind /mnt/data/media /srv/mediaMount --bind makes a folder show up in a second placeShows the same folder at a second path, which works where a symlink does not.27 Nov 2026 - Tip
sudo mount -o remount,noatime /mnt/dataNoatime stops Linux from writing a timestamp every time you read a fileStops the filesystem from updating access times on every read, which saves writes on data disks.27 Nov 2026 - Tip
sudo mkswap /swapfileMkswap and swapon add a swap file without repartitioningGives a Linux machine swap space from a plain file, without changing any partitions.27 Nov 2026 - Tip
sudo umount -l /mnt/nasUmount -l detaches a hung network share, but read the fine printFrees the mount point of a hung network share so the machine can shut down cleanly.27 Nov 2026 - Tip
sudo dmesg -n 4Dmesg -n stops kernel messages from flooding the consoleKeep kernel messages off your console screen while they still land in the log.27 Nov 2026 - Tip
sudo apt install plocatePlocate finds a file by name in milliseconds, from an indexLooks up files by name in a prebuilt index instead of walking the whole disk.27 Nov 2026 - Tip
grep -n -C 3 'segfault' /var/log/sysloggrep -C 3 shows the lines around each matchShows a few lines before and after every match, so you see what led up to an error.27 Nov 2026 - Tip
grep -F '192.168.1.1' /var/log/nginx/access.loggrep -F searches for text literally, dots and brackets includedSearches for text exactly as you typed it, without regex characters getting in the way.27 Nov 2026 - Tip
grep -n -m 1 'Out of memory' /var/log/sysloggrep -m 1 stops reading after the first matchMakes grep quit after the first match, or after any number you choose.27 Nov 2026 - Tip
grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/auth.loggrep -o prints only the part of the line that matchedPrints only the matched text, like IP addresses, instead of the whole log line.27 Nov 2026 - Tip
grep -w port /etc/ssh/sshd_configgrep -w matches whole words, so log stops matching loginOnly matches your search term as a whole word, not inside longer words.27 Nov 2026 - Tip
sudo mkdir -p /etc/systemd/journald.conf.dForwardToConsole in journald.conf puts the live log on a spare ttyShow every new journal line on a spare virtual terminal of the machine.27 Nov 2026 - Tip
sudo localectl set-locale LANG=en_US.UTF-8 LC_TIME=nl_NL.UTF-8Localectl set-locale keeps English messages with European date formatsSets English system messages with Dutch-style 24-hour date and time formatting.27 Nov 2026 - Tip
loginctl list-sessionsloginctl terminate-session closes a stale SSH login for goodEnds a hanging login session and every process that belongs to it.27 Nov 2026 - Tip
timedatectltimedatectl set-local-rtc 0 keeps the hardware clock in UTCStops the clock from jumping an hour after reboots by storing hardware time in UTC.27 Nov 2026 - Tip
sudo logrotate -d /etc/logrotate.d/myappLogrotate -d shows what a rotation would do without touching a fileTest a logrotate config and see what it would rotate, without changing any log.27 Nov 2026 - Tip
systemd-analyze condition 'ConditionHost=nas*' 'ConditionVirtualization=!vm'systemd-analyze condition tests Condition= lines on the machine you run it onChecks on the spot whether a unit's Condition lines would let it start on this machine.27 Nov 2026 - Tip
systemd-analyze exit-status 203systemd-analyze exit-status explains a code like 203/EXECLooks up what a numeric service exit status means and where it comes from.27 Nov 2026 - Tip
sudo systemctl edit mysync.serviceConditionPathExists= lets a systemd service skip itself when a file is missingSkips starting a service, without marking it failed, when a chosen file is absent.27 Nov 2026 - Tip
[Service]EnvironmentFile= keeps a systemd service's settings in a separate fileLoads a service's environment variables from a separate file you can edit freely.27 Nov 2026 - Tip
sudo systemctl edit myapp.serviceLoadCredential= hands a secret to a systemd service without an environment variableGives a service a password as a private read-only file instead of an environment variable.27 Nov 2026 - Tip
RemainAfterExit=yesRemainAfterExit=yes keeps a one-shot systemd service marked as activeKeeps a run-once setup service active after its script exits, so stop runs cleanly.27 Nov 2026 - Tip
sudo systemctl edit myapp-worker.servicePartOf= makes a systemd service stop and restart along with another oneLets a helper service follow its main service when that one stops or restarts.27 Nov 2026 - Tip
[Path]A systemd .path unit starts a service when a file changesRuns a service automatically whenever a watched file or folder changes.27 Nov 2026 - Tip
sudo systemd-run --on-active=30min /usr/local/bin/backup.shsystemd-run --on-active runs a command once, a bit laterSchedules a single command for later without at or a unit file.27 Nov 2026 - Tip
sudo systemd-run --shell -p User=www-data -p ProtectHome=yessystemd-run --shell opens a shell with the environment a service getsOpens an interactive shell under the same conditions a systemd service runs in.27 Nov 2026 - Tip
sudo systemd-run --wait -P -G -p CPUAccounting=yes -p MemoryAccounting=yes /usr/local/bin/backup.shsystemd-run --wait reports runtime and exit code when a command endsRuns a command as a service and prints its runtime and exit status afterwards.27 Nov 2026 - Tip
sudo systemctl edit myapp.serviceStandardOutput=append: writes a systemd service's output to a plain log fileSends a service's output to a normal text log file instead of the journal.27 Nov 2026 - Tip
sudo systemctl enable --now myapp.serviceSystemctl enable --now starts a service and turns it on at boot in one goEnables a service for every boot and starts it right now with one command.27 Nov 2026 - Tip
systemctl get-defaultsystemctl set-default multi-user.target boots a Linux box without the desktopMakes a Linux machine boot to a text login without starting the desktop.27 Nov 2026 - Tip
[Unit]One systemd timer can have several OnCalendar= linesGives one timer several schedules, such as different times on weekdays and weekends.27 Nov 2026 - Tip
d /srv/scratch 0755 root root 14dOne tmpfiles.d line deletes old files from a folder on scheduleRemoves files older than a set age from a directory every day, without cron.27 Nov 2026 - Tip
sudo smartctl -n standby -H /dev/sdbSmartctl -n standby skips a sleeping disk instead of spinning it upReads SMART data only when a disk is awake, so a check never spins it up.27 Nov 2026 - Tip
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.Dpkg --configure -a finishes an install that was cut offFinishes the setup of packages left half installed after an interrupted apt run.27 Nov 2026 - Tip
sudo update-alternatives --config editorupdate-alternatives --config editor picks the editor Ubuntu opensChanges which program Ubuntu starts as the default editor, or any other alternative.27 Nov 2026 - Tip
sudo smartctl -l scterc /dev/sdaSmartctl -l scterc shows how long a disk keeps retrying a bad sectorShows and sets how long a hard disk retries a bad sector before it reports an error.27 Nov 2026 - Tip
sudo smartctl -l xerror /dev/sdaSmartctl -l xerror shows the errors a disk logged, and newer drives only log them therePrints the extended error log of a disk, with the failed commands and when they happened.27 Nov 2026 - Tip
printf 'root\nbackup\n' | sudo tee /etc/cron.allow/etc/cron.allow decides which users may use crontab at allLimits which user accounts are allowed to create and edit their own cron jobs.27 Nov 2026 - Tip
CRON_TZ=Europe/AmsterdamCRON_TZ= runs a crontab on another time zone, if your cron is cronieLets a crontab use local Dutch time even when the server clock runs on UTC.27 Nov 2026 - Tip
*/15 * * * * /usr/local/bin/poll.sh # 15 divides 60, so every gap is 15 minutes*/7 in a cron minute field starts over every hour, so the gaps are unevenExplains why a cron step that does not divide 60 gives one short gap every hour.27 Nov 2026 - Tip
sudo badblocks -sv /dev/sdXBadblocks -sv reads a whole disk to find bad blocks without writing to itReads every block of a disk and lists the ones that cannot be read, without writing.27 Nov 2026 - Tip
sudo e2fsck -fn /dev/sdb1e2fsck -n checks an ext4 filesystem without changing anythingChecks an ext4 filesystem for errors and only reports them, without repairing anything.27 Nov 2026 - Tip
resolvectl statisticsresolvectl statistics shows how often the DNS cache really hitsPrints cache hits, misses and DNSSEC verdicts from systemd-resolved so you can judge the cache.27 Nov 2026 - Tip
journalctl -u backup.service -Ijournalctl -u with -I shows only the latest run of a serviceShows the log lines of only the last run of a service, or the run before it.27 Nov 2026 - Tip
sudo chown alice: report.pdfChown alice: with a trailing colon also sets the user's own groupGives a file to a user and that user's own group in one short command.27 Nov 2026 - Tip
sudo mount -o uid=1000,gid=1000,fmask=0133,dmask=0022 /dev/sdb1 /mnt/usbChmod does nothing on a FAT USB stick, set uid and umask when you mount itMakes a FAT-formatted USB drive writable for your own user with mount options.27 Nov 2026 - Tip
grep -E '^(HOME_MODE|UMASK)' /etc/login.defsHOME_MODE and DIR_MODE decide the permissions of new home foldersSets how private the home folder of every new user account is.27 Nov 2026 - Tip
sudo auditctl -a always,exit -F arch=b64 -F path=/etc/passwd -F perm=wa -k passwd-changeAn auditd rule logs who changed /etc/passwd, even after a sudoLogs every change to an important file together with the user who logged in.27 Nov 2026 - Tip
journalctl -b _SYSTEMD_UNIT=ssh.service + _COMM=sudoA lone + in journalctl combines two matches with ORCombines two journal matches with OR instead of AND, so one command shows two sources together.26 Nov 2026 - Tip
journalctl -xb -p errjournalctl -x adds an explanation under the log lines that have oneAdds a short explanation beneath journal entries that have one in the message catalog.26 Nov 2026 - Tip
journalctl --show-cursor -n 20journalctl --show-cursor and --after-cursor continue where you stoppedShows an opaque bookmark after the last line so a later run can continue from there.26 Nov 2026 - Tip
journalctl --cursor-file=/var/tmp/jc.cursor -u myappjournalctl --cursor-file reads only the new entries on every runRemembers where the last run ended in a file, so each run prints only new entries.26 Nov 2026 - Tip
journalctl /dev/sdajournalctl /dev/sda shows kernel messages about one diskShows only the journal entries about one device, such as a failing disk, for the current boot.26 Nov 2026 - Tip
journalctl -D /mnt/backup/var/log/journal -b -1journalctl -D reads the journal of another machine from a copied directoryReads journal files from any directory, for example a disk taken from a machine that no longer boots.26 Nov 2026 - Tip
journalctl -b /usr/sbin/sshdjournalctl /usr/sbin/sshd shows the logs of one program by its pathFilters the journal by a program's file path, which works when you do not know the unit name.26 Nov 2026 - Tip
journalctl -o export > journal.exportjournalctl -o export makes a text-based copy of the journal you can moveWrites journal entries with all their fields to a stream that can be stored or imported elsewhere.26 Nov 2026 - Tip
journalctl --facility=auth,authpriv --since todayjournalctl --facility=auth,authpriv shows only login and security messagesFilters the journal by syslog facility, for example login and privilege messages only.26 Nov 2026 - Tip
journalctl --file='/var/log/journal/*/system.journal' -n 20journalctl --file reads one journal file or a set of them by globReads the entries of specific journal files matching a glob instead of the system journal.26 Nov 2026 - Tip
journalctl -kfjournalctl -kf follows the kernel log liveFollows kernel messages live, handy while you plug in or remove hardware.26 Nov 2026 - Tip
journalctl -u nginx -f --no-tailjournalctl -f --no-tail follows a service and prints its whole history firstPrints all matching entries and then keeps following, instead of starting with the last ten lines.26 Nov 2026 - Tip
journalctl -g timeout -n 5journalctl -g combined with -n shows the newest matches firstCombining a text search with a line count prints the newest matches first, because the order flips.26 Nov 2026 - Tip
journalctl --header | head -20journalctl --header shows what is inside the journal filesPrints the header information of the journal files instead of log entries.26 Nov 2026 - Tip
journalctl -M mycontainer -bjournalctl -M reads the journal of a running local containerReads the journal of a running systemd container from the host by its machine name.26 Nov 2026 - Tip
[Journal]MaxLevelStore in journald.conf stops journald from storing debug messagesMakes journald drop messages above a chosen level before they are stored, such as debug.26 Nov 2026 - Tip
journalctl -m -bjournalctl -m merges the journals of all users and remote sourcesShows entries from all available journals, local and remote, in one time-ordered stream.26 Nov 2026 - Tip
journalctl --namespace=myappjournalctl --namespace reads a separate journal namespaceShows the logs of one journal namespace, or all namespaces at once with a star.26 Nov 2026 - Tip
journalctl --no-full -u myappjournalctl --no-full cuts long log lines to fit your terminalShortens log lines that do not fit the terminal width so a list stays scannable.26 Nov 2026 - Tip
journalctl --no-hostname -u ssh -n 5journalctl --no-hostname removes the host name from every lineLeaves the host name out of the short log lines to save space.26 Nov 2026 - Tip
journalctl -u ssh --no-pager | grep -c Acceptedjournalctl --no-pager sends the output straight to the next commandPrints the output directly instead of opening a pager, which suits scripts and pipes.26 Nov 2026 - Tip
journalctl -n +20journalctl -n +20 prints the oldest 20 entries instead of the newestShows the oldest journal entries, which tells you how far back the history goes.26 Nov 2026 - Tip
journalctl -u myapp -o catjournalctl -o cat prints only the message textPrints just the message text of each entry, without time stamps or host names.26 Nov 2026 - Tip
journalctl -o json --output-fields=MESSAGE,PRIORITY -n 3journalctl --output-fields keeps JSON output to the fields you nameLimits JSON or verbose output to the fields you list, which keeps scripts small and fast.26 Nov 2026 - Tip
journalctl -b -o short-delta -u myappjournalctl -o short-delta shows the gap between each line and the one beforePrints the time since the previous entry on every line, to find long pauses and timeouts.26 Nov 2026 - Tip
journalctl -o short-full -u myappjournalctl -o short-full prints time stamps with weekday, year and time zoneShows complete time stamps that you can paste straight into --since and --until.26 Nov 2026 - Tip
journalctl -b -o short-monotonicjournalctl -o short-monotonic counts seconds since bootPrints seconds since boot as the time stamp, which reads well for startup problems.26 Nov 2026 - Tip
journalctl -o short-unix -u myappjournalctl -o short-unix gives time stamps scripts can calculate withPrints the time as seconds since 1970 so a script can calculate with it.26 Nov 2026 - Tip
journalctl -o with-unit -u 'getty@*'journalctl -o with-unit shows the full unit name in front of each linePrefixes each line with the full unit name, including the instance of templated services.26 Nov 2026 - Tip
journalctl -u nginx -ejournalctl -e opens the pager at the end of the journalStarts the pager at the last entries, limited to 1000 lines of the current boot.26 Nov 2026 - Tip
journalctl -q -b -1journalctl -q hides the — Reboot — lines and permission warningsRemoves journalctl's own informational lines, so only real log entries remain.26 Nov 2026 - Tip
[Journal]RateLimitBurst in journald.conf explains why a chatty service loses log linesExplains and changes the per-service limit that makes journald drop messages in a burst.26 Nov 2026 - Tip
journalctl -r -u sshjournalctl -r puts the newest entries on topReverses the order so the newest journal entry is shown first.26 Nov 2026 - Tip
journalctl --root=/mnt/system -b -1journalctl --root reads the logs of a system mounted under a directoryReads the journal of another system that is mounted under a directory, such as a rescue mount.26 Nov 2026 - Tip
[Journal]RuntimeMaxUse in journald.conf limits a journal that lives in memoryCaps the size of the in-memory journal, which matters on small machines such as a Raspberry Pi.26 Nov 2026 - Tip
journalctl -a -u myservicejournalctl -a shows long or binary fields in fullShows complete log fields, including long ones and ones that normally appear as blob data.26 Nov 2026 - Tip
[Journal]SyncIntervalSec in journald.conf explains why the last lines before a crash may be missingSets how often journald syncs its files to disk, which decides how much a crash can lose.26 Nov 2026 - Tip
sudo journalctl --syncJournalctl --sync makes sure every log line is on disk before you continueForces journald to write all pending log data to disk and returns when it is done.26 Nov 2026 - Tip
[Journal]SystemKeepFree in journald.conf leaves disk space for everything elseTells journald to keep a minimum of disk space free, as a floor next to the size cap.26 Nov 2026 - Tip
journalctl --truncate-newline -u myappjournalctl --truncate-newline shows only the first line of multiline messagesCuts every message after its first line, so long traces do not flood the screen.26 Nov 2026 - Tip
journalctl --since today _UID=$(id -u)journalctl _UID=$(id -u) shows what your own processes loggedShows the journal entries written by processes that run under one user ID, for example your own.26 Nov 2026 - Tip
journalctl --user -u myappjournalctl --user shows the logs of the services in your own sessionShows the logs of services that run in your own user session instead of the system.26 Nov 2026 - Tip
sudo journalctl --vacuum-files=5Journalctl --vacuum-files=5 keeps only five archived journal filesKeeps a fixed number of archived journal files and removes the oldest ones.26 Nov 2026 - Tip
sudo journalctl --vacuum-time=2weeksJournalctl --vacuum-time=2weeks deletes archived journal files older than two weeksRemoves archived journal files older than a chosen time span and reports the freed space.26 Nov 2026 - Tip
journalctl --verifyjournalctl --verify checks the journal files for corruptionChecks every journal file for corruption and reports PASS or FAIL for each file.26 Nov 2026 - Tip
sudo fuser -vm /mnt/backupFuser -vm shows which process keeps a Linux disk busy when umount failsFinds the processes that use a mount or a port, so you know what blocks an unmount.26 Nov 2026 - Tip
sudo lsns -t netLsns lists the Linux namespaces on a host, including those of your containersLists namespaces and the processes in them, which shows how containers are separated.26 Nov 2026 - Tip
sudo dmidecode -t memoryDmidecode -t memory shows which RAM is in your Linux box without opening itLists the memory slots, module sizes and speeds of a machine from the firmware tables.26 Nov 2026 - Tip
pstree -ppstree -p shows which process started which on Linux, with PIDsDraws the running processes as a tree, so you see parents, children and their PIDs.26 Nov 2026 - Tip
sudo loginctl enable-linger aliceLoginctl enable-linger keeps your systemd user services running after you log outLets systemd user services start at boot and keep running when you are not logged in.26 Nov 2026 - Tip
sudo tailscale set --operator=$USERTailscale set --operator lets your own user run tailscale without rootGives one Linux user the right to operate tailscaled, so routine commands need no sudo.26 Nov 2026 - Tip
sudo arping -D -I eth0 -c 3 192.168.1.50Arping -D checks if an IP address is already takenChecks whether another device on your LAN already answers to an IP address.25 Nov 2026 - Tip
sudo ip addr add 192.0.2.10/24 dev eth0Ip addr add gives an interface a temporary extra addressAdds an extra IP address to an interface right away, and the address disappears again after a reboot.25 Nov 2026 - Tip
sudo nft list rulesetNft list ruleset shows the active nftables firewall rulesPrints every table, chain and rule that nftables currently has loaded in the kernel.25 Nov 2026 - Tip
echo 'price=42 EUR' | grep -oP '\d+(?= EUR)'Grep -P uses Perl-compatible regular expressionsLets grep use Perl-style patterns such as lookahead and \d, which the basic and extended syntax lack.25 Nov 2026 - Tip
sudo passwd -l olduserPasswd -l locks a Linux account password, but SSH keys still workDisables a user's password login on Linux, and what else is needed to really block the account.25 Nov 2026 - Tip
sshfs user@server:/srv/data ~/remotesshfs mounts a remote folder over SSH like a local driveMounts a directory from another machine on a local folder, using nothing more than an SSH login.25 Nov 2026 - Tip
sudo ethtool eth0Ethtool eth0 shows the link speed and duplex of a network portShows the negotiated speed, duplex mode and link status of a network interface.24 Nov 2026 - Tip
sudo lastb | head -n 20Lastb lists failed login attempts on a Linux serverShows the log of bad login attempts that Linux keeps in /var/log/btmp.24 Nov 2026 - Tip
ssh -G myserver | grep -E '^(hostname|user|port|identityfile) 'ssh -G shows the settings SSH will really use for a hostPrints the final SSH settings for a host after every Host and Match block is applied, without connecting.24 Nov 2026 - Tip
sudo findmnt --verify --verboseFindmnt --verify checks fstab before a reboot can break the disk mountsChecks fstab for typos and missing devices without mounting anything.24 Nov 2026 - Tip
sudo mount -o remount,ro /mnt/dataMount -o remount,ro puts a disk read-only without unmounting itSwitches a mounted filesystem to read-only in place, so a failing disk stops receiving writes.24 Nov 2026 - Tip
sudo parted /dev/sdb unit GiB print freeParted print free shows the unused space on a diskLists partitions together with the unallocated gaps between them, in readable units.24 Nov 2026 - Tip
udevadm info --query=property --name=/dev/sda | grep -E 'ID_MODEL=|ID_SERIAL_SHORT='udevadm info reads the serial number of a disk without opening the casePrints model and serial number of a drive from the udev database so you can identify it.24 Nov 2026 - Tip
sudo blkid /dev/sdb1Blkid prints the UUID to use in fstab for a diskPrints the stable UUID and filesystem type of a partition so fstab does not depend on changing device names.24 Nov 2026 - Tip
snap list --all | awk '/disabled/{print $1, $3}' | while read name rev; do sudo snap remove "$name" --revision="$rev"; donesnap list --all reveals the old revisions you can removeFinds and removes inactive snap revisions that waste disk space.24 Nov 2026 - Tip
sudo apt cleanApt clean empties the cache of downloaded .deb filesDeletes cached package downloads to free disk space on the system.24 Nov 2026 - Tip
sudo apt install --reinstall coreutilsApt install --reinstall brings back files you deleted by mistakeReinstalls a package and restores config files that were deleted.24 Nov 2026 - Tip
sudo apt install ./vendor-tool_2.1_amd64.debApt install ./file.deb installs a local package and resolves its dependenciesInstalls a downloaded .deb file and pulls in the dependencies it needs.24 Nov 2026 - Tip
dpkg -L nginx-common | grep etcdpkg -L lists every file an apt package put on your systemLists all the files that an installed package has put on disk.24 Nov 2026 - Tip
sudo apt install apt-fileapt-file search finds the apt package that ships a missing fileFinds which package provides a file, even when that package is not installed.24 Nov 2026 - Tip
sudo apt upgradeApt full-upgrade can remove packages that apt upgrade never removesLets apt install or remove packages to finish upgrades that are kept back.24 Nov 2026 - Tip
curl -V | grep -E '^(Protocols|Features)'curl -V shows which protocols and features your build supportsLists the protocols and features compiled into the curl you are running.24 Nov 2026 - Tip
nginx -V 2>&1 | tr ' ' '\n' | grep -- --with-nginx -V lists the modules your build has before you use a directiveShows the configure flags and modules of the installed nginx binary.24 Nov 2026 - Tip
sudo nginx -s reloadNginx -s reload lets old workers finish their requests, a restart does notApplies a changed configuration while connections that are in progress finish normally.24 Nov 2026 - Tip
Persistent=truePersistent=true gives a systemd timer the catch-up that plain cron lacksMakes a systemd timer run a missed job right after boot.24 Nov 2026 - Tip
journalctl -u cron --since todayjournalctl -u cron shows when each cron job startedLists the log lines that prove whether cron started a given job and at what time.24 Nov 2026 - Tip
anacron -Tanacron runs the cron jobs that a powered-off machine missedRuns periodic jobs after boot when the computer was off at their normal time.24 Nov 2026 - Tip
0 9 13 * 5 /usr/local/bin/report.shA cron line with both day-of-month and weekday runs when either one matchesShows that restricting both day fields in a cron schedule widens it instead of narrowing it.24 Nov 2026 - Tip
MAILTO=""MAILTO="" in a crontab stops cron from mailing every job's outputTurns off or redirects the mail cron sends with the output of each job.24 Nov 2026 - Tip
journalctl -b -p warning..errjournalctl -p warning..err selects a priority rangeSelects log lines between two severity levels, such as warnings up to errors.24 Nov 2026 - Tip
journalctl -u nginx -u mariadb --since "30 min ago" -fjournalctl -u twice merges the logs of two services in time orderShows the logs of several services in a single time-ordered stream.24 Nov 2026 - Tip
journalctl -u ssh -g "failed|invalid user" --since yesterdayjournalctl -g searches log messages with a regular expressionFilters journal messages with a regular expression and keeps the timestamps and paging.24 Nov 2026 - Tip
journalctl -F _SYSTEMD_UNITjournalctl -F lists every value a log field has hadLists all unique values of a journal field, so you know what to filter on.24 Nov 2026 - Tip
sudo mkdir -p /var/log/journalA persistent journalctl history needs /var/log/journal to existMakes the journal survive reboots by creating the directory journald uses for disk storage.24 Nov 2026 - Tip
journalctl --disk-usagejournalctl --disk-usage tells you how much space the journal takesReports the total disk space used by the system journal files.24 Nov 2026 - Tip
journalctl -o short-iso -u ssh --since todayjournalctl -o short-iso gives timestamps you can compare across serversPrints log timestamps in ISO 8601 or UTC so logs from different hosts can be compared.24 Nov 2026 - Tip
journalctl -b -2 -u nginxjournalctl --list-boots shows which boots the journal still holdsLists every boot the journal knows, with offsets you can pass to -b.24 Nov 2026 - Tip
Restart=on-failureSystemd Restart=on-failure with StartLimitBurst stops a restart loopRestarts a crashed service after a pause and gives up after too many quick failures.24 Nov 2026 - Tip
systemd-analyze verify /etc/systemd/system/myapp.servicesystemd-analyze verify finds typos in a unit file before you start itChecks a unit file for unknown directives and missing binaries without starting anything.24 Nov 2026 - Tip
systemd-analyze security nginx.servicesystemd-analyze security scores how locked down a service isRates the sandboxing of a service from 0 to 10 and lists the options that are still open.24 Nov 2026 - Tip
ExecStart=A systemd drop-in must clear ExecStart= before it sets a new oneReplaces the start command of a service in a drop-in by clearing the inherited one first.24 Nov 2026 - Tip
systemctl cat nginx.servicesystemctl cat prints a systemd unit together with all its drop-insPrints the unit file plus every drop-in override in application order.24 Nov 2026 - Tip
timedatectltimedatectl shows whether your server clock is in syncPrints the local time, the time zone and whether the clock is synchronised with an NTP server.23 Nov 2026 - Tip
systemd-analyze blamesystemd-analyze blame shows which services slow down your bootLists every service by how long it took to start during the last boot, slowest first.21 Nov 2026 - Tip
crontab -e@reboot in a crontab runs a command at every startupRuns a script once at every boot, straight from your crontab.19 Nov 2026 - Tip
sudo dmesg -T | tail -30Dmesg -T gives kernel messages readable timestampsShows kernel messages with real clock times instead of seconds since boot.19 Nov 2026 - Tip
ssh-keygen -R nas.localssh-keygen -R removes the old host key when SSH shouts about a changed fingerprintClears the old host key so SSH stops warning about a changed fingerprint after a reinstall.17 Nov 2026 - Tip
systemctl --failedsystemctl --failed lists every service that did not startLists every service that failed to start, so you know after a reboot if everything came back.17 Nov 2026 - Tip
journalctl -p err -bjournalctl -p err -b shows only what went wrong since the last bootShows only the errors in the system log since the last boot.16 Nov 2026 - Tip
sudo tailscale set --accept-routesLinux needs tailscale set --accept-routes to use subnet routesMakes a Linux machine use the subnet routes that other tailnet devices advertise.3 Oct 2026 - Tip
sudo setfacl -m u:alice:rX /srv/dataSetfacl gives one extra user access without changing the groupGives one extra named user access to a folder without touching owner or group.11 Sep 2026 - Tip
[Resolve]Turn on DNS over TLS in systemd-resolvedMakes systemd-resolved send all DNS queries over an encrypted TLS connection.10 Sep 2026 - Tip
resolvectl flush-cachesresolvectl flush-caches clears the DNS cache on LinuxEmpties the local DNS cache of systemd-resolved without restarting the service.23 Aug 2026 - Tip
stat -c '%a %U:%G %n' /etc/ssh/sshd_configstat -c prints the permissions as numbersPrints a file's permissions as an octal number with owner, group and name.18 Aug 2026 - Tip
resolvectl query example.comresolvectl query shows how a name was resolvedResolves a name through systemd-resolved and shows which link, protocol and cache gave the answer.5 Aug 2026 - Tip
sudo snap revert firefoxSnap revert puts a snap back on its previous versionRolls a snap back to the previously installed revision after a bad update.26 Jul 2026 - Tip
sudo snap refresh --hold=72h firefoxSnap refresh --hold pauses one snap without turning updates offPauses automatic updates of one snap for a set time, or forever, and can be undone.18 Jul 2026 - Tip
sudo du -h -d1 -x /var | sort -hdu -h -d1 | sort -h finds what is eating your diskLists directory sizes with the biggest last, so you see what fills the disk.17 Jul 2026 - Tip
sudo apt autoremove --purgeApt autoremove --purge also deletes the leftover config filesRemoves unused dependency packages together with their leftover configuration files.11 Jul 2026 - Tip
systemctl list-timers --allsystemctl list-timers is cron's answer inside systemdShows every scheduled systemd timer with its last and next run time.9 Jul 2026 - Tip
systemd-analyze blamesystemd-analyze blame shows what slows down your bootLists services by how long they took to start, so you can see what slows the boot.4 Jul 2026 - Tip
sudo systemctl edit nginxSystemctl edit changes a service without touching the originalLets you change a systemd service in a separate file that updates will not overwrite.24 Jun 2026 - Tip
sudo apt install --no-install-recommends–no-install-recommends stops apt from dragging in extrasInstalls a package with only its required dependencies and skips the merely recommended ones.24 Jun 2026 - Tip
journalctl --disk-usagejournalctl --vacuum-size caps how much log space you keepShrinks the systemd journal to a size you pick by deleting the oldest logs.16 Jun 2026 - Tip
sudo apt-mark hold postgresql-16apt-mark hold keeps one package on the version you haveFreezes one package at its current version while everything else keeps updating.9 Jun 2026 - Tip
sudo !!Type sudo !! when you forgot the sudoReruns your previous command with sudo in front, so you do not retype it.1 Jun 2026 - Tip
sudo tcpdump -ni any port 53 -c 20Tcpdump -ni any port 53 shows linux DNS traffic without WiresharkCaptures a few DNS packets from the command line and prints them.29 May 2026 - Tip
sudo lsof -nP -i :53Lsof -i :8080 names the linux process that holds a portShows which process is listening on a given port, with its PID and owner.27 May 2026 - Tip
sudo find / -xdev -type f -perm -4000 2>/dev/null | sort > suid-today.txtFind -perm -4000 lists SUID programs, a security audit that takes one lineLists files that run with their owner's privileges so unexpected ones stand out.25 May 2026 - Tip
sudo -lsudo -l shows what a user may run as root, a quick security check of sudoersShows which commands a user may run with sudo and under which conditions.24 May 2026 - Tip
sudo lynis audit systemLynis audit system gives a security report with a hardening score for your serverAudits a Linux host read-only and lists warnings and suggestions with a hardening index.23 May 2026 - Tip
sudo fail2ban-client status sshdfail2ban-client status sshd shows who is banned, a quick security checkShows the matches and banned addresses of a fail2ban jail, and how to lift a ban.22 May 2026 - Tip
sudo sshd -t && sudo systemctl reload sshRun sshd -t before every restart, the cheapest security habit for SSHValidates the sshd configuration first and reloads only when the check succeeds.21 May 2026 - Tip
find . -name '*.py' -exec grep -l 'TODO' {} +find -exec grep -l {} + runs one command for many files instead of one eachRuns a command on batches of matched files instead of once per file.20 May 2026 - Tip
sudo find / -xdev \( -nouser -o -nogroup \) -ls 2>/dev/nullFind -nouser -o -nogroup lists files whose owner no longer existsLists files that belong to a user or group id nobody uses.20 May 2026 - Tip
sudo find / -xdev -type f -perm -4000 2>/dev/nullFind -perm -4000 lists every setuid program on the systemLists every file that runs with the rights of its owner.20 May 2026 - Tip
sudo getcap -r / 2>/dev/nullGetcap -r / lists the programs that carry extra permissionsLists all files on the system that have file capabilities set.19 May 2026 - Tip
sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/myappSetcap lets a program bind port 80 without root permissionsGrants a program the right to open low ports without running it as root.19 May 2026 - Tip
sudo chown -c -R --from=1000:1000 www-data:www-data /srv/siteChown --from changes the owner only where the old owner matches, a permissions-safe filterChanges the owner of only the files that currently belong to a given user or group.18 May 2026 - Tip
sudo fstrim -avFstrim -av tells the SSD which blocks of the disk are freeTrims all mounted filesystems that support it, which keeps SSD write speed up.18 May 2026 - Tip
sudo hdparm -tT /dev/sdaHdparm -tT gives a quick read speed number for a diskMeasures how fast a disk reads sequentially, as a quick health and cabling check.18 May 2026 - Tip
sudo iotop -oPaIotop -oPa shows which program wrote the most to the diskLists the processes currently reading or writing the disk, with accumulated totals.17 May 2026 - Tip
sudo ufw status verboseUfw status verbose shows the defaults and the logging levelPrints active state, default policies and log level with the rule list.11 May 2026 - Tip
sudo ufw app listUfw app list shows the ready-made profiles for installed servicesUses named service profiles to open the right ports with one word.10 May 2026 - Tip
sudo nginx -T | lessNginx -T prints the whole merged config, every include file in one goPrints the complete configuration nginx would load, with each included file marked.2 May 2026 - Tip
run-parts --test /etc/cron.dailyrun-parts --test shows which cron.daily scripts will really runLists which scripts in a cron directory would be executed without running them.2 May 2026 - Tip
*/5 * * * * flock -n /run/lock/sync.lock /usr/local/bin/sync.shFlock -n stops a cron job from overlapping with its own previous runSkips a scheduled run when the previous one still holds a lock file.1 May 2026 - Tip
*/10 * * * * /usr/local/bin/sync.sh >> /var/log/sync.log 2>&1End a cron line with >> file 2>&1 to keep all output in one logSends both normal output and errors of a scheduled job to a log file you can read later.29 Apr 2026 - Tip
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binSet PATH at the top of a crontab, because cron jobs do not get your login PATHGives every job in a crontab the same PATH and shell so commands are found like in a terminal.28 Apr 2026 - Tip
stty saneReset and stty sane repair a terminal that shows garbageRestores a terminal that was scrambled by binary output.20 Apr 2026 - Tip
ps aux | less -SLess -S stops long lines wrapping in the terminalKeeps wide output on one line per row and lets you scroll sideways.19 Apr 2026 - Tip
script -q -a session.logscript -a session.log records everything in your terminal to a fileSaves a full terminal session, input and output, to a text file.15 Apr 2026 - Tip
sudo timedatectl set-timezone Europe/AmsterdamTimedatectl set-timezone fixes the zone of a linux serverSets the system time zone with a name from the official list.12 Apr 2026 - Tip
sudo hostnamectl set-hostname nas01Hostnamectl set-hostname renames a linux machine the proper wayChanges the hostname of a systemd machine at once and keeps it after a reboot.12 Apr 2026 - Tip
lscpu | grep -E 'Model name|Socket|Core|Thread|Virtualization'lscpu tells you cores, threads and virtualization support on linuxSummarizes the CPU model, core and thread counts and virtualization flags.11 Apr 2026 - Tip
sudo dmesg --level=err,warnDmesg --level=err,warn filters the linux kernel log by severityShows only kernel errors and warnings instead of the whole ring buffer.10 Apr 2026 - Tip
sudo sysctl -w vm.swappiness=10Sysctl -w tries a linux kernel setting, a file in sysctl.d keeps itChanges a kernel setting at once and keeps it across reboots with one small file.9 Apr 2026 - Tip
launchctl list | grep -v com.applelaunchctl list shows the background jobs of your macos account, minus Apple'sShows the third-party launch agents loaded for your user with their status.4 Mar 2026 - Tip
sudo find / -xdev -type f -size +500M -exec ls -lh {} +Find -size +500M -xdev lists big files on one filesystem onlyLists large files on one filesystem so you can see what is filling it.18 Feb 2026 - Tip
sudo chattr +i /srv/app/settings.confChattr +i makes a file immutable, which normal permissions cannot do for rootLocks a file against any change, including by root, until the flag is removed.15 Feb 2026 - Tip
sudo -u www-data test -r /srv/site/config.php && echo can read || echo blockedsudo -u www-data test -r proves the web server really has the permissionsTests whether another user, such as the web server, can read or write a path.14 Feb 2026 - Tip
sudo chmod --reference=/etc/ssh/sshd_config /etc/ssh/sshd_config.newChmod --reference copies the permissions of another fileGives one file exactly the mode of another file.9 Feb 2026 - Tip
sudo install -m 640 -o root -g www-data app.env /etc/app/app.envInstall -m sets permissions, owner and group while it copies the fileCopies a file and sets its mode, owner and group in one command.8 Feb 2026 - Tip
sudo chmod 1777 /srv/dropboxChmod +t sets sticky permissions, so nobody deletes the files of othersStops users from deleting each other's files in a folder everyone can write to.5 Feb 2026 - Tip
sudo chmod g+s /srv/sharedChmod g+s on a shared folder fixes the group permissions of new filesMakes new files in a directory inherit its group, so a team can share the folder.5 Feb 2026 - Tip
sudo smartctl -d sat -a /dev/sdbSmartctl -d sat reads smart data of a drive in a USB enclosureReads the smart data of a USB-attached drive by using SAT pass-through.5 Feb 2026 - Tip
sudo smartctl --scanSmartctl --scan lists every device with the -d type to use for smartLists the devices smartctl can read and the -d type that fits each.4 Feb 2026 - Tip
sudo smartctl -t long /dev/sdaSmartctl -t long reads the whole surface, and a smart log keeps the resultStarts a full-surface self-test inside the drive and shows how long it will take.4 Feb 2026 - Tip
sudo smartctl -t short /dev/sdaSmartctl -t short runs a quick smart self-test inside the driveStarts a quick background self-test on the drive and reads the result from its log.2 Feb 2026 - Tip
sudo smartctl -a /dev/nvme0Smartctl -a on an NVMe drive shows wear and spare capacity in smartShows wear, spare capacity and error counts of an NVMe drive.2 Feb 2026 - Tip
sudo smartctl -A /dev/sda | grep -E '^ *(5|197|198|199) 'Smartctl -A shows the smart attributes that predict a failing diskFilters the smart attributes down to reallocated, pending, uncorrectable and CRC error counts.2 Feb 2026 - Tip
sudo smartctl -H /dev/sdaSmartctl -H prints the smart verdict, and PASSED is not a clean billPrints the overall smart health verdict of a drive in one line.1 Feb 2026 - Tip
sudo wipefs /dev/sdbWipefs lists the signatures on a disk before you erase any of themLists and removes old filesystem and RAID signatures from a disk, with a dry-run option.1 Feb 2026 - Tip
sudo dd if=debian.iso of=/dev/sdX bs=4M status=progress conv=fsyncDd status=progress shows a disk copy, and of= decides what you destroyCopies an image to a disk with live progress, and the target device decides what gets overwritten.1 Feb 2026 - Tip
sudo tune2fs -m 1 /dev/sdb1tune2fs -m 1 gives back the reserved space on a large data diskLowers the share of an ext4 disk that is reserved for root, so you get the space back.1 Feb 2026
Other tips226
- Tip
a2query -m rewritea2query -m rewrite tells you if an Apache module is switched onCheck whether an Apache module is enabled, and get a clean exit code for scripts.3 Dec 2026 - Tip
renice -n 10 -p 4242renice -n 10 -p PID makes a running process less greedyLower the priority of a job that is already running, without restarting it.3 Dec 2026 - Tip
xvfb-run -a your-program --some-flagxvfb-run -a runs a graphical program on a server with no screenGive a graphical program a virtual display on a headless machine.3 Dec 2026 - Tip
sed -n '$=' access.logsed -n '$=' prints how many lines a file hasPrint the number of lines in a file, or the line numbers of matches, with sed.3 Dec 2026 - Tip
dpkg --get-selections > packages.txtdpkg --get-selections rebuilds your package set on a new machineSaves the installed package list so another machine can install the same set.3 Dec 2026 - Tip
flatpak uninstall --unusedflatpak uninstall --unused removes runtimes nothing needs anymoreDeletes Flatpak runtimes that no installed app uses anymore.3 Dec 2026 - Tip
lastlog --before 90lastlog --before finds accounts that have not logged in latelyList accounts that have not logged in for a number of days3 Dec 2026 - Tip
comm --total a.txt b.txtcomm --total counts the lines that differ between two sorted filesAdds a last line with how many lines are only in file one, only in file two, and in both.3 Dec 2026 - Tip
dpkg --compare-versions 1.10 gt 1.9 && echo newerdpkg --compare-versions tells a script which version is newerCompares two Debian version strings and answers with the exit code.3 Dec 2026 - Tip
printf '%s\n' a b c d e f | xargs -n1 -P3 --process-slot-var=SLOT sh -c 'echo "slot $SLOT got $0"; sleep 0.2'Xargs --process-slot-var gives every parallel job a worker numberSets an environment variable in each parallel xargs job, holding the slot number it runs in.3 Dec 2026 - Tip
Unattended-Upgrade::InstallOnShutdown "true";InstallOnShutdown moves unattended-upgrades to the moment you power offInstalls the updates during shutdown instead of in the background.3 Dec 2026 - Tip
patch -R g.txt < f.patchpatch -R undoes a patch you appliedReverses a patch, so the files go back to how they were before it was applied.3 Dec 2026 - Tip
setfacl -m m::rx fileThe ACL mask caps what named users and groups can doExplains the mask entry, and how setfacl -m m::rx removes write access from all named entries at once.3 Dec 2026 - Tip
find / -maxdepth 1 -fstype procfind -fstype matches files by the type of filesystem they live onSelects files that sit on a given filesystem type, and -printf %F shows which type that is.3 Dec 2026 - Tip
findmnt --pollfindmnt --poll prints a line every time something is mounted or unmountedWatches the mount table and prints each mount, umount, remount or move as it happens.3 Dec 2026 - Tip
GRUB_TIMEOUT_STYLE=hiddenGRUB_TIMEOUT_STYLE=hidden keeps the GRUB menu out of sight until you need itHides the GRUB menu behind a short timeout, and the menu still appears when you press ESC or hold Shift.3 Dec 2026 - Tip
lsinitramfs /boot/initrd.img-$(uname -r)lsinitramfs lists what is inside the initramfs of your running kernelLists the files in an initramfs image, so you can check a driver is in it.3 Dec 2026 - Tip
sysctl vm.vfs_cache_pressureVm.vfs_cache_pressure sets how eagerly Linux drops cached folder listingsControls how strongly the kernel reclaims directory and inode caches, with 100 as the default.3 Dec 2026 - Tip
rotate 4Olddir in logrotate moves rotated logs into a folder of their ownKeeps all rotated copies of a log in one separate directory instead of next to the live file.3 Dec 2026 - Tip
:%s/<Ctrl-r><Ctrl-w>/newname/gCtrl-r Ctrl-w in the Vim command line types the word under the cursorPastes the word under the cursor into a command or search you are typing in Vim.2 Dec 2026 - Tip
/oldname:%s//new/g in Vim replaces whatever you searched for lastAn empty pattern in a substitute command reuses your last search, so you can look first and replace after.2 Dec 2026 - Tip
atop -w /tmp/atop.raw 60 30atop -w and atop -r record and replay system activityRecords system and process statistics to a file and lets you step through them afterwards.2 Dec 2026 - Tip
find . -name "*.conf" | vim -Command | vim – opens the output of a command in a Vim bufferReads text from a pipe into a new Vim buffer so you can search and edit it.2 Dec 2026 - Tip
vim --clean file.txtvim --clean starts Vim without your vimrc and pluginsStarts Vim with default settings and no personal config, to find out whether your setup causes a problem.2 Dec 2026 - Tip
:set textwidth=72Gq with textwidth makes Vim rewrap long lines of textRewraps a paragraph or a selection to a fixed line width, such as 72 characters.2 Dec 2026 - Tip
:mksession:mksession saves your Vim windows and files, and vim -S brings them backSaves the open files and window layout to a file so you can restore it later.2 Dec 2026 - Tip
view /etc/fstabview opens a file in Vim in read-only modeOpens a file with Vim's navigation and search, but blocks accidental saves.2 Dec 2026 - Tip
lsmem --summarylsmem --summary shows how much memory the kernel seesPrints the online and offline memory the kernel manages and the size of one memory block.2 Dec 2026 - Tip
nano -l file.txtSet linenumbers in your nanorc shows line numbers in every nano sessionTurns on line numbers permanently in nano, so you don't need the -l flag each time.2 Dec 2026 - Tip
upower -i /org/freedesktop/UPower/devices/battery_BAT0upower -i shows battery details on a Linux laptopLists power devices and prints detailed battery information from the command line.2 Dec 2026 - Tip
:checkhealth:checkhealth in Neovim shows what is wrong with your setupRuns Neovim's self-checks and reports missing tools, broken plugins and provider problems.2 Dec 2026 - Tip
lspci -tlspci -t draws the PCI bus as a treeShows buses, bridges and devices as a tree, so you see what hangs off what.2 Dec 2026 - Tip
echo 'hello world' | sed 's/.*/\U&/'Sed \U and \L change the case of the text you just matchedUpper- or lowercases a match inside the replacement part of an s command in GNU sed.2 Dec 2026 - Tip
lacp-rate: fastLacp-rate: fast makes a netplan 802.3ad bond check its partner every secondOnly used in 802.3ad mode, lacp-rate chooses between a slow 30 second and a fast one second LACP interval.2 Dec 2026 - Tip
"+p paste from the clipboardYank to the plus register to copy from Vim to the system clipboardMove text from Vim to any other program with a register.1 Dec 2026 - Tip
snap refresh --listsnap can list the updates that are waiting before it installs themPreview pending snap updates without installing any of them.1 Dec 2026 - Tip
snap servicessnap restart bounces the services of a snap without a rebootRestart a misbehaving snap service by name, after seeing what it runs.1 Dec 2026 - Tip
sort -m app.log worker.log | lesssort -m merges several logs into one timelineRead events from two files in the order they happened.1 Dec 2026 - Tip
sed -E 's/[0-9]+/N/g' app.log | sort | uniq -c | sort -rn | head -n 15Mask the numbers in logs and uniq -c finds the message that repeats mostCollapse near identical lines to see which message dominates a file.1 Dec 2026 - Tip
awk '$1 >= "2026-11-30T02:00" && $1 < "2026-11-30T03:00"' app.logawk can cut a time window out of logs that use ISO timestampsExtract only the lines between two moments from a large file.1 Dec 2026 - Tip
rotate 14Delaycompress leaves the newest rotated logs uncompressed for one roundKeep yesterday's file readable and avoid compressing a file still in use.1 Dec 2026 - Tip
tail -c 2000 export.jsontail -c works in bytes, which helps with huge or one line filesLook at the end of a file that has very long lines or none.1 Dec 2026 - Tip
tail -f --pid=1234 build.logtail can stop following a file once the writing process endsWatch a job's output and get your prompt back when the job finishes.1 Dec 2026 - Tip
udevadm monitorudevadm monitor shows hardware events live while you plug things inWatch the system react the moment a device appears or disappears.1 Dec 2026 - Tip
for f in /proc/[0-9]*/status; doVmSwap in /proc shows which processes have memory in swapList the programs that are actually sitting in swap, biggest first.1 Dec 2026 - Tip
fc-cache -f -v ~/.local/share/fontsfc-cache -f makes newly copied fonts show up by rebuilding the font cacheGet programs to see a font you just copied into your home folder.1 Dec 2026 - Tip
rclone lsf -R --files-only --format tsp remote:photosrclone lsf prints a plain file listing that scripts can readLists remote files with exactly the columns you ask for.1 Dec 2026 - Tip
rclone about remote:rclone about shows how much room is left on a remoteReports total, used, free and trashed space for a cloud account.1 Dec 2026 - Tip
ls -vls -v lists numbered files so that 2 comes before 10Sort names with numbers in them the way a person would count.1 Dec 2026 - Tip
prlimit --pid 1234 --nofileprlimit changes the limits of a Linux process that is already runningRaise the open files limit of a running service without restarting it.30 Nov 2026 - Tip
cat /proc/sys/fs/file-nr/proc/sys/fs/file-nr shows how many file handles the whole Linux system has openSee system wide open file usage next to its maximum in one line.30 Nov 2026 - Tip
cut -d: -f1,7 /etc/passwd | jq -R 'split(":") | {user: .[0], shell: .[1]}'Jq -R reads plain text lines, so jq can build records from themTurn ordinary text lines into strings jq can split, filter and wrap.30 Nov 2026 - Tip
chrt -i 0 ./reindex.shchrt -i 0 runs a Linux job only when the CPU has nothing better to doGive a background job the idle scheduling class, lower than even nice 19.30 Nov 2026 - Tip
. /etc/os-releaseSourcing /etc/os-release gives a Linux script the distro name and versionLet a script check which distribution and release it runs on, without parsing text.30 Nov 2026 - Tip
find /srv/downloads -type f -size +100M -size -1G -exec ls -lh {} +Two find -size tests give you a size rangeLists files between two sizes, for example everything between 100 MB and 1 GB.30 Nov 2026 - Tip
openssl version -dopenssl version -d shows where OpenSSL looks for its config and CA storeFind the folder OpenSSL uses for openssl.cnf and trusted certificates on this machine.30 Nov 2026 - Tip
sysctl kernel.panicKernel.panic = 10 makes a headless Linux box reboot itself after a kernel panicHave a remote server restart on its own instead of hanging forever after a panic.30 Nov 2026 - Tip
find /srv -xdev -samefile /srv/downloads/movie.mkvfind -samefile lists every hard link to the same fileShows all the names a file has on disk, so you know what still keeps it alive.30 Nov 2026 - Tip
-o Dpkg::Options::="--force-confold" upgradeApt with force-confold keeps your edited config files in unattended upgradesStops apt from asking about changed config files during scripted upgrades.30 Nov 2026 - Tip
SELECT table_schema, table_name,One information_schema query lists the biggest tables in your database serverShows which tables use the most disk space, data and indexes together, in megabytes.30 Nov 2026 - Tip
ip link set dev eth0 mtu 1400ip link set mtu changes the MTU of a Linux interface for a quick testTry a smaller or larger MTU on one interface without editing any network config.30 Nov 2026 - Tip
findmnt -no OPTIONS /dev/shmMount /dev/shm with noexec for a little extra security on a serverStops programs from being run directly out of the shared memory folder.30 Nov 2026 - Tip
find . -name '*.orig' -print0 | xargs -0 -p rmXargs -p asks for a yes before each command it runsShows every command xargs is about to run and waits for you to confirm it.30 Nov 2026 - Tip
wc -L access.logwc -L prints the length of the longest line in a fileCheck how wide a file is before you print it, wrap it or set a column width.30 Nov 2026 - Tip
find / -xdev -user olduser -ls 2>/dev/nullfind -user lists everything one account ownsLists the files that belong to one user, for a cleanup or before you remove the account.30 Nov 2026 - Tip
find . -name '*.gz' -print0 | xargs -0 -n 1 gzip -tXargs exits with 123 when one of its commands failedExplains xargs exit codes, so a script can tell whether every command it ran succeeded.30 Nov 2026 - Tip
tail -f access.log | cut -d' ' -f1 | uniqStdbuf -oL makes a command in the middle of a pipe print each line right awayStop a pipeline from holding back output until a buffer of several kilobytes is full.30 Nov 2026 - Tip
SHOW TABLE STATUS LIKE 'orders'\GData_free in SHOW TABLE STATUS tells you whether OPTIMIZE TABLE will shrink a database tableChecks how much reclaimable space a table holds before rebuilding it to shrink it.30 Nov 2026 - Tip
find /srv/archive \( -name '*.txt' -fprint txt.list \) -o \( -name '*.gz' -fprint gz.list \)find -fprint writes several result lists in one passSorts search results into separate files without walking the folder tree twice.30 Nov 2026 - Tip
sort hosts.txt | uniq -dUniq -d shows only the duplicate lines and uniq -u only the unique onesFind the entries that appear twice in a list, or the ones that appear once.30 Nov 2026 - Tip
cut -d, -f2 --complement people.csvcut can drop a single column and keep all the othersRemove a single field from a CSV or log without listing every field you want to keep.30 Nov 2026 - Tip
find / -xdev -lname '/mnt/olddisk/*' -ls 2>/dev/nullfind -lname finds symlinks by where they pointLists the symbolic links that point to a certain path, for example before you move a folder.30 Nov 2026 - Tip
:bufdo %s/oldhost/newhost/ge | updateVim's :bufdo runs one command in every open fileApplies the same change to all buffers in one go.30 Nov 2026 - Tip
find /srv -maxdepth 1 -type d,lfind -type d,l matches several file types in one testLists folders and symlinks together without writing two type tests joined with -o.30 Nov 2026 - Tip
find /srv/app -name '*.log' -mtime +30 -exec mv -t /srv/old-logs {} +find -exec mv -t moves many files with one mv commandMoves all the files find selects into one folder with a handful of mv calls instead of one per file.30 Nov 2026 - Tip
choom -p 1234choom tells the Linux OOM killer which process to spare and which to sacrificeProtect an important process, or offer up a less important one, when memory runs out.30 Nov 2026 - Tip
find /etc /var/www -ctime -1 -lsfind -ctime catches permission changes that find -mtime missesFinds files whose owner or permissions changed recently, even when their content did not.30 Nov 2026 - Tip
newgrp medianewgrp gives your shell the permissions of a new group without logging outStarts a shell that already has a group you were just added to.30 Nov 2026 - Tip
apt-cache search --names-only zstdapt-cache search -n finds a package by its name, without the noiseSearches package names only, so results don't drown in description matches.30 Nov 2026 - Tip
:set ff=unixSet ff=unix in Vim removes Windows line endingsConverts a file with Windows line endings back to Unix ones.30 Nov 2026 - Tip
find . -name '*.txt' -exec sh -c 'for f; do cp -- "$f" "${f%.txt}.bak"; done' sh {} +find -exec sh -c lets each file go through a small scriptRuns a few commands per file from find, with the file name passed safely.30 Nov 2026 - Tip
sysctl vm.overcommit_memoryVm.overcommit_memory decides whether Linux promises more memory than it hasUnderstand why a program got memory it could not use, and when to change the policy.30 Nov 2026 - Tip
rm -I *.logrm -I asks once before a big delete instead of for every fileGet one sanity check before a large or recursive delete, without the endless prompts of rm -i.30 Nov 2026 - Tip
sort -u -k1,1 logins.txtsort -u -k1,1 keeps one line per key instead of one per whole lineRemove duplicates based on one column, like keeping one line per host name.30 Nov 2026 - Tip
strace -c -f ./slow-script.shstrace -c counts the system calls of a Linux program to show where its time goesGet a summary table of syscalls, errors and time instead of thousands of trace lines.30 Nov 2026 - Tip
echo /srv/media/films/2024/clip.mkv | rev | cut -d/ -f1 | revRev | cut | rev gets the last field of a line, however many fields it hasTake the last part of a path or line when the number of fields changes.30 Nov 2026 - Tip
find . -name '*.txt' -o -name '*.log' -printfind -o needs parentheses, or -print only applies to the last nameExplains why find with two -name tests and -print shows only one kind of file.30 Nov 2026 - Tip
cat /proc/cmdlinecat /proc/cmdline shows the boot options your Linux kernel really started withCheck whether a kernel option you added to GRUB actually reached the kernel.30 Nov 2026 - Tip
apt list '~o'apt list '~o' finds installed packages that no repository offers anymoreLists packages that no longer exist in any configured repository, so they get no updates.30 Nov 2026 - Tip
iconv -f latin1 -t utf-8 old.csv > new.csviconv converts an old Latin-1 file to UTF-8 so the accents show up rightFix the garbled characters in an old export by converting its encoding.30 Nov 2026 - Tip
mount -t tmpfs -o size=512M,mode=1777 tmpfs /mnt/scratchmount -t tmpfs -o size= gives you a folder that lives in RAM on LinuxCreate a fast scratch folder in memory with a hard size cap.30 Nov 2026 - Tip
printf 'a b\nc d\n' | xargs -L 1 echo line:Xargs -L 1 runs one command per input line, not per wordKeeps each input line together as the arguments of one command run.30 Nov 2026 - Tip
csplit -s -z -f part- dump.sql '/^CREATE TABLE/' '{*}'csplit cuts a text file into pieces wherever a pattern matchesSplit a long log or dump into separate files at every line that starts a new section.30 Nov 2026 - Tip
find /var -xdev -type f -printf '%h\n' | sort | uniq -c | sort -rn | headfind -printf '%h' counts files per folderShows which folders hold the most files, for finding the place with a million cache files.30 Nov 2026 - Tip
if kill -0 "$pid" 2>/dev/null; thenKill -0 checks whether a Linux process is still alive without touching itTest from a script whether a PID still exists before you wait for it or start a new copy.30 Nov 2026 - Tip
ln -sr /srv/site/shared/uploads /srv/site/current/uploadsln -sr makes a relative symlink, so the link keeps working when you move the treeCreate a symlink with a relative path without counting the dots yourself.30 Nov 2026 - Tip
watch -g -n 5 ls /srv/inbox && echo 'new file in the inbox'watch -g waits until the output of a command changes and then stopsWait for a file, a service or a disk to change without writing a loop.30 Nov 2026 - Tip
apt policy openssh-serverapt holds back some Ubuntu updates on purpose because of phased updatesExplains the deferred due to phasing message and when to override it.30 Nov 2026 - Tip
printf 'x\ny\n' | xargs -t touchXargs -t prints each command before it runsShows the exact commands xargs builds, which makes a pipeline easy to check and debug.30 Nov 2026 - Tip
find ~/bin /usr/local/bin -type f -executablefind -executable checks whether you can run a file, not only the x bitLists the files the current user can actually execute, instead of guessing from permission bits.30 Nov 2026 - Tip
find /var/log/app -daystart -type f -mtime 0 # changed todayfind -daystart makes -mtime count calendar days instead of 24 hoursMakes find's day tests start at midnight, so yesterday means yesterday on the calendar.30 Nov 2026 - Tip
truncate -s 0 /var/log/app/debug.logtruncate -s 0 empties a log file that a program still has openFree the space of a runaway log without deleting the file or restarting the program.30 Nov 2026 - Tip
ip route add 198.51.100.0/24 via 192.0.2.1ip route add sends one subnet through another gateway until the next rebootRoute a single network via a different router without touching your config files.30 Nov 2026 - Tip
cat defaults.jsonJq '. * input' merges a config file with an override fileDeep merge two config files so the second one overrides only what it sets.30 Nov 2026 - Tip
fmt -w 72 notes.txtfmt -w rewraps a paragraph so all lines get the same lengthReflow ragged lines in notes, commit messages or a README to one width.30 Nov 2026 - Tip
find -L /srv/media -name '*.mkv'find -L follows symlinked folders that find normally skipsMakes find search inside folders that are reached through symbolic links.30 Nov 2026 - Tip
ldd /usr/local/bin/toolldd lists the shared libraries a Linux program needs and which ones are missingFind out why a program will not start with 'error while loading shared libraries'.30 Nov 2026 - Tip
xargs --show-limits < /dev/nullxargs can show how long one command line may be on your systemPrints the system's limit on command length and the buffer size xargs really uses.30 Nov 2026 - Tip
last -x shutdown reboot | headlast -x shows whether a Linux server shut down cleanly or just went darkSee the reboots and shutdowns of a machine, so you can tell a crash from a planned restart.30 Nov 2026 - Tip
head -n -5 report.txthead -n -5 prints a whole file except the last five linesCut off a footer or trailing lines without counting how long the file is.30 Nov 2026 - Tip
find -files0-from dirs.list -name '*.log'find -files0-from reads the folders to search from a fileFeeds a long list of starting folders to find from a file instead of the command line.30 Nov 2026 - Tip
cat /proc/sys/kernel/tainted/proc/sys/kernel/tainted tells you why your Linux kernel counts as taintedDecode the taint number to see which loaded module or event marked the kernel.30 Nov 2026 - Tip
sysctl fs.protected_regular fs.protected_fifos fs.protected_symlinks fs.protected_hardlinksFs.protected_regular stops tricks with files other users leave in Linux /tmpMake sure a program cannot be fooled into writing to a file another user planted in /tmp.30 Nov 2026 - Tip
apt-config dump | lessapt-config dump shows the apt settings that are really in effectPrints the merged configuration from every file in apt.conf.d.30 Nov 2026 - Tip
find . -type f -size -1024kfind -size -1M only finds empty files, because find rounds sizes upExplains why small files go missing from a find -size search, and how to fix it.30 Nov 2026 - Tip
ps -eo stat,pid,wchan:32,cmd | awk '$1 ~ /^D/'ps shows the Linux processes stuck in D state, the ones that drive up load without CPUFind what makes the load average high while the CPU looks idle.30 Nov 2026 - Tip
ls /var/run/reboot-required && cat /var/run/reboot-required.pkgs/var/run/reboot-required tells you that an Ubuntu or Debian update needs a rebootCheck after updates whether a reboot is needed, and which packages asked for it.30 Nov 2026 - Tip
find: possible unquoted pattern after predicate `-name'?Quote the pattern after find -name, or the shell changes it firstPrevents the shell from expanding a wildcard before find gets to see it.30 Nov 2026 - Tip
precedence ::ffff:0:0/96 100One line in gai.conf makes Linux prefer IPv4 when IPv6 is brokenMake programs try the IPv4 address first when a host has both.30 Nov 2026 - Tip
printf 'old1.txt new1.txt\nold2.txt new2.txt\n' | xargs -n 2 mvXargs -n 2 hands the input to a command two items at a timeSplits a list into fixed-size groups, so each command run gets exactly the number of arguments it needs.30 Nov 2026 - Tip
find /srv/site -type f -printf '%P\n'find -printf '%P' prints paths without the starting folderGives you paths relative to the folder you searched, ready for another command.30 Nov 2026 - Tip
ls -iFind -inum deletes a file whose name you can't typeRemoves a file with a strange name by its inode number instead of its name.30 Nov 2026 - Tip
sysctl kernel.dmesg_restrict kernel.kptr_restrictKernel.dmesg_restrict keeps the kernel log away from normal users, a security sysctlStops unprivileged users from reading the kernel ring buffer with dmesg.30 Nov 2026 - Tip
cat /proc/sys/fs/inotify/max_user_watchesFs.inotify.max_user_watches fixes 'no space left' errors from file watchers on LinuxRaise the inotify watch limit when an editor, sync tool or dev server cannot watch your files.30 Nov 2026 - Tip
Types: debApt .sources files are deb822 now, and Enabled: no switches one offShows the newer repository format and how to disable a source cleanly.30 Nov 2026 - Tip
ip -j addr show eth0 | jq -r '.[0].addr_info[] | select(.family=="inet") | .local'ip -j prints JSON, so jq can pull out an addressPrints network information as JSON so a script can read an address reliably.28 Nov 2026 - Tip
zramctlzramctl shows the compressed swap that lives in your RAMLists zram devices and sets up compressed swap in memory.28 Nov 2026 - Tip
rpi-eeprom-configrpi-eeprom-config prints the bootloader settings of your Raspberry PiShows the boot settings stored in the Pi's bootloader EEPROM before you change them.28 Nov 2026 - Tip
mpstat -P ALL 2 5mpstat -P ALL shows what each CPU core is doing, not just the averagePrint one line per CPU core every few seconds to spot a single busy core, I/O wait or steal time.28 Nov 2026 - Tip
dpkg-query -W -f='${Package}\t${Version}\n' 'openssh-*'dpkg-query -W -f prints exactly the package fields you ask forPrints chosen fields of installed packages, such as name and version, in a format scripts can read.28 Nov 2026 - Tip
gi back to where you stopped typing, in Insert modegi in Vim returns to where you last typed and starts insertingJumps back to the place where you last left Insert mode and starts typing again there.28 Nov 2026 - Tip
mat2 --show report.pdfmat2 shows and removes the metadata in PDFs, Office files and imagesLists and removes metadata from documents, images and other files, writing a cleaned copy.28 Nov 2026 - Tip
:%s/error//gn:%s/pattern//gn counts matches in Vim without changing anythingCounts how many times a pattern appears in the file, using the substitute command's n flag.28 Nov 2026 - Tip
sysctl vm.swappinessVm.swappiness tells linux how expensive swap is compared with the page cacheSets how eagerly linux swaps out memory compared with dropping page cache.28 Nov 2026 - Tip
pidstat -u -r -d 1 -e tar czf /tmp/test.tar.gz ~/Documentspidstat -e watches a command only for as long as it runsStarts a command and reports its CPU, memory and disk use every second until it ends.28 Nov 2026 - Tip
fwupdmgr securityfwupdmgr security gives your firmware a Host Security IDRates the firmware protections of a Linux machine from HSI:0 to HSI:5 and explains each failed test.28 Nov 2026 - Tip
mokutil --sb-statemokutil --sb-state tells you if Secure Boot is onShows whether UEFI Secure Boot is switched on for the running system.28 Nov 2026 - Tip
clamscan -r -i /mnt/user/shareclamscan -r -i scans a folder and prints only the infected filesScans a folder recursively with ClamAV and lists only the infected files.28 Nov 2026 - Tip
find /mnt/user/downloads -name '*.zip' -execdir unzip -n {} \;find -execdir runs a command inside the folder where each file livesRuns a command from the folder of each matched file, so output lands next to it.27 Nov 2026 - Tip
cp -r --update=none /mnt/user/photos/import/* /mnt/user/photos/library/Use cp --update=none instead of cp -n, which changed behaviour twiceCopies or moves files without overwriting existing ones, with an exit status you can predict.27 Nov 2026 - Tip
mv app.log "app-$(date -r app.log +%F).log"Date -r prints the modification time of a file in any format you likeShows when a file was last changed, formatted the way your script needs it.27 Nov 2026 - Tip
ln -sf /srv/app/releases/v2 /srv/app/currentln -sfn repoints a symlink to a folder instead of creating a link inside itReplaces a symlink that points to a directory, rather than adding a link inside that directory.27 Nov 2026 - Tip
for i in $(seq -w 1 "$n"); doSeq -w counts with leading zeros, so file names sort the right wayPrints a number sequence with leading zeros, so numbered names line up and sort correctly.27 Nov 2026 - Tip
tail -n +2 export.csvtail -n +2 prints a file from its second line, so the header is gonePrints a file starting at a chosen line, for example to skip a CSV header.27 Nov 2026 - Tip
touch -r notes.orig.md notes.mdtouch -r copies the timestamp of one file onto anotherGives a file the same modification time as another file, or any date you choose.27 Nov 2026 - Tip
rotate 4Copytruncate rotates a log for programs that never let go of the fileRotate the log of a program that keeps its log file open and can't reopen it.27 Nov 2026 - Tip
rotate 14Dateext puts the date in rotated log names instead of a numberName rotated log files after their date, so you find the right day at once.27 Nov 2026 - Tip
rotate 4The su line in logrotate fixes "parent directory has insecure permissions"Let logrotate rotate logs in a folder that a normal user or app can write to.27 Nov 2026 - Tip
zgrep -i 'out of memory' /var/log/syslog*zgrep searches rotated .gz logs without unpacking themSearches compressed and plain log files with one grep command, no unpacking needed.27 Nov 2026 - Tip
join <(sort hosts.txt) <(sort roles.txt)join matches two files on a shared column, like a tiny SQL joinCombines lines from two text files that share the same value in a key column.27 Nov 2026 - Tip
sort -t, -k3,3n people.csvsort -t and -k sort a file on one column instead of the whole lineSorts lines on one chosen column, as text or as numbers, instead of on the whole line.27 Nov 2026 - Tip
sort -o list.txt list.txtsort -o sorts a file in place, where a redirect would empty itSorts a file and writes the result back into the same file without emptying it first.27 Nov 2026 - Tip
printf '%s\n' 1.10.0 1.9.2 1.2.0 | sort -VSort -V puts version numbers in the right orderSorts version numbers like 1.9 and 1.10 in the order a person would expect.27 Nov 2026 - Tip
cat -E script.sh | headTr -d '\r' strips Windows line endings from a fileRemoves the hidden carriage returns that make Windows text files misbehave on Linux.27 Nov 2026 - Tip
wc -l < access.logwc -l < file gives you only the number, without the file namePrints just the line count of a file, so you can use it directly in a script.27 Nov 2026 - Tip
find . -maxdepth 1 -name '*.conf' | xargs -I {} cp {} {}.bakXargs -I {} puts each input line exactly where you want it in the commandPlaces each input line at a chosen spot in the command, not just at the end.27 Nov 2026 - Tip
tar -xzf app-2.4.1.tar.gz -C /mnt/user/appdata/app --strip-components=1tar --strip-components=1 drops the top folder when you unpackUnpacks an archive straight into an existing folder without the extra version folder.27 Nov 2026 - Tip
less /var/log/apt/history.log/var/log/apt/history.log shows what apt installed and whenShows which packages apt installed, upgraded or removed, on which date and by which command.27 Nov 2026 - Tip
find /mnt/user/photos -iname '*.jpg'find -iname matches file names whatever their upper and lower caseFinds files by name while ignoring upper and lower case, so .JPG and .jpg both match.27 Nov 2026 - Tip
lspci -klspci -k shows which kernel driver handles each PCI deviceLists PCI devices together with the kernel driver in use and the modules that could drive them.25 Nov 2026 - Tip
realpath ../../data/./file.txtrealpath resolves a path and can print it relative to another folderTurns a messy path with dots and symlinks into a clean absolute path, or one relative to a folder.25 Nov 2026 - Tip
fallocate -l 1G test.imgfallocate -l 1G file reserves a file of that size instantlyPreallocates disk space for a file of the size you ask, without writing all the data like dd would.25 Nov 2026 - Tip
getent passwd jordigetent passwd looks up users the way the system doesQueries the user database through the Name Service Switch, so it also finds users from LDAP or other sources.25 Nov 2026 - Tip
lsusb -tlsusb lists USB devices, and lsusb -t shows them as a treeLists the USB devices the kernel sees, with the -t option showing how hubs and devices connect.25 Nov 2026 - Tip
uptime -puptime -p prints how long a machine has been running in wordsShows the system uptime as readable text, such as weeks, days and hours, instead of the classic load line.25 Nov 2026 - Tip
cmp -l file1.bin file2.bin | headcmp compares two files byte by byte, and cmp -l lists every differenceCompares two files byte by byte and reports where they first differ, or all differing bytes with -l.25 Nov 2026 - Tip
echo "a very long sentence that keeps going and going" | fold -s -w 20Fold -s -w 60 wraps long lines at spacesWraps long lines to a chosen width and breaks them at spaces instead of in the middle of words.25 Nov 2026 - Tip
nl -ba -w 4 -s ': ' /etc/hostsnl -ba puts line numbers in front of every line, blank ones tooAdds line numbers to the output of a file or command, numbering empty lines as well.25 Nov 2026 - Tip
echo 1610612736 | numfmt --to=iecNumfmt --to=iec turns byte counts into readable sizes like 1.5GConverts plain numbers into human-readable sizes, and works on any number that you pipe into it.25 Nov 2026 - Tip
printf '%q\n' "$name"printf %q quotes a string so the shell can read it back safelyPrints a value with escaping, so spaces and special characters survive when it is pasted back into a shell command.25 Nov 2026 - Tip
inotifywait -m -e close_write /srv/inboxinotifywait waits until a file changes, then lets your script go onBlocks until something happens to a file or folder, so a script can react without polling.24 Nov 2026 - Tip
split -b 1G -d --additional-suffix=.part big.iso big.iso.split -b cuts a big file into pieces you can send or storeSplits a large file into fixed-size parts with numbered names, which cat can join back together.24 Nov 2026 - Tip
ip route get 1.1.1.1ip route get shows which route and source address the kernel would useAsks the kernel which gateway, interface and source address it would pick for a destination, without sending anything.24 Nov 2026 - Tip
tracepath -n example.comtracepath traces the route and path MTU without needing rootTraces the route to a host like traceroute and reports the path MTU, as a normal user.24 Nov 2026 - Tip
gpg --import project-signing-key.ascgpg --verify checks a signature file against the file it signsVerifies that a downloaded file matches its detached signature and was signed by the key you expect.24 Nov 2026 - Tip
date -d '2 days ago' +%Fdate -d understands phrases like 'next friday' and '2 days ago'Turns plain-English dates such as yesterday or next friday into a real date on the command line.24 Nov 2026 - Tip
pkill -x nodepkill -x only kills processes whose name matches exactlyStops processes by exact name, so killing 'vim' does not also take down 'gvim' or 'vimdiff'.24 Nov 2026 - Tip
tac /var/log/app.log | head -n 20tac prints a file backwards, last line firstPrints the lines of a file in reverse order, which puts the newest log entry on top.24 Nov 2026 - Tip
wsl --list --verbosewsl --list --verbose shows which Linux distros run and on which WSL versionLists the installed WSL distributions with their state and whether they run on WSL 1 or WSL 2.24 Nov 2026 - Tip
snap refresh --timesnap refresh --time shows when the next snap update is dueShows the snap update schedule and moves it to a quiet time window.24 Nov 2026 - Tip
apt -s full-upgradeapt -s runs a simulated install or upgrade and changes nothingShows what an install or upgrade would do without changing the system.24 Nov 2026 - Tip
apt-mark showmanual > packages.txtapt-mark showmanual lists what you installed yourselfPrints the packages you installed on purpose, which makes rebuilds easier.24 Nov 2026 - Tip
Pin: version 1.24.*Apt pinning in preferences.d locks a package to one version rangeTells apt which version of a package to prefer, and keeps it there.24 Nov 2026 - Tip
apt-cache rdepends --installed libssl3apt-cache rdepends shows what needs a package before apt removes itLists installed packages that depend on a given package.24 Nov 2026 - Tip
tree -L 2tree -L 2 shows a folder structure two levels deepDraws the files and folders of a directory as a tree, cut off at the depth you choose.23 Nov 2026 - Tip
ps aux --sort=-%mem | head -n 6ps aux --sort=-%mem | head shows which programs eat your memoryLists the processes using the most memory first, so you can see what is filling your RAM.23 Nov 2026 - Tip
free -hfree -h has an available column, and that is the one to readShows how much memory programs can still use, including cache that Linux gives back when asked.23 Nov 2026 - Tip
ip -br addressip -br address shows every interface and its IP on one linePrints one line per network interface with its state and IP addresses.21 Nov 2026 - Tip
do-release-upgrade -cdo-release-upgrade -c checks for a new Ubuntu release without starting oneChecks whether a newer Ubuntu release is available and reports it without starting an upgrade.2 Oct 2026 - Tip
Unattended-Upgrade::Automatic-Reboot "true";Let unattended-upgrades reboot at 04:00 instead of neverMakes automatic updates restart the machine at a fixed night time when a reboot is needed.24 Sep 2026 - Tip
ip -br aip -br a is the readable version of ip addrShows each network interface with its state and addresses on a single line.23 Sep 2026 - Tip
umask 027umask decides the permissions of every new fileSets the default permissions for new files and directories so others get no access.6 Sep 2026 - Tip
chmod -R u=rwX,go=rX /srv/siteUse a capital X in chmod so only directories get executeSets sensible permissions in one pass: execute only on directories and already-executable files.24 Aug 2026 - Tip
apt changelog openssh-serverapt changelog shows why a package wants to updateShows the maintainers' notes for a package so you know what an update actually changes.4 Jul 2026 - Tip
apt list --upgradableapt list --upgradable shows what is waiting before you upgradeLists the packages that have a newer version available without installing anything.2 Jun 2026 - Tip
vmstat 1 5vmstat 1 5 shows linux CPU, swap and I/O wait in one tablePrints CPU, memory, swap and I/O wait figures once per second.29 May 2026 - Tip
cat /proc/$pid/limitscat /proc/PID/limits shows the real linux limits of a running processPrints the resource limits that apply to one running process.28 May 2026 - Tip
strace -f -e trace=openat -o /tmp/open.txt myprogram --servestrace -f -e trace=openat shows which files a linux program opensRecords every file a program tries to open, including the ones that do not exist.27 May 2026 - Tip
find /var/www -perm /o+w ! -type lfind -perm /o+w lists files that anyone can write toLists files and folders in which the others class has write access.20 May 2026 - Tip
find . -name node_modules -prune -o -type f -name '*.js' -printfind -name node_modules -prune skips a folder instead of walking itSkips a whole directory tree during a search, such as a dependency folder.19 May 2026 - Tip
find /etc -type f -mmin -30find -mmin -30 lists the files that changed in the last half hourLists the files that were modified within the last number of minutes.19 May 2026 - Tip
snap connections firefoxsnap connections shows which resources a snap may useLists the sandbox permissions of a snap and whether each is connected.15 May 2026 - Tip
snap info lxdsnap info shows channels, tracking and the installed revisionShows which channels a snap offers and which one you follow.13 May 2026 - Tip
apt download htopapt download fetches a .deb without installing itSaves a package as a .deb file in the current directory without installing it.9 May 2026 - Tip
apt-mark showholdapt-mark showhold lists the packages apt will leave aloneLists the packages that are held back, so you can see why an upgrade skips them.24 Apr 2026 - Tip
uptimeThe uptime load average only means something next to your linux CPU countGives the load average and the CPU count so you can judge whether the load is high.10 Apr 2026 - Tip
ulimit -Snulimit -Sn only changes the open files limit of this linux shellRaises the open files limit for one shell session, up to the hard limit.9 Apr 2026 - Tip
free -hfree -h counts the page cache as available memory, so drop_caches is rarely neededExplains the buff/cache column and how to drop the kernel page cache for testing.7 Apr 2026 - Tip
pg_isready -h 127.0.0.1 -p 5432pg_isready checks whether a PostgreSQL database accepts connections, using an exit codeTests PostgreSQL availability without credentials and returns a script-friendly exit code.4 Mar 2026 - Tip
sqlite3 app.db "EXPLAIN QUERY PLAN SELECT * FROM users WHERE email = '[email protected]';"EXPLAIN QUERY PLAN shows whether a SQLite database query uses an indexShows whether SQLite reads a whole table or uses an index for a given query.2 Mar 2026 - Tip
sqlite3 -header -csv app.db "SELECT id, email FROM users" > users.csvsqlite3 -header -csv exports a query result from a database as CSVExports SQLite query results to a CSV file and imports a CSV back with the shell.2 Mar 2026 - Tip
sqlite3 app.db "PRAGMA integrity_check;"PRAGMA integrity_check tells you whether a SQLite database file is damagedVerifies the structure of a SQLite file and reports damage or broken foreign keys.1 Mar 2026 - Tip
FROM pg_stat_user_tables ORDER BY n_dead_tup DESC LIMIT 10;Pg_stat_user_tables shows which database tables autovacuum is behind onFinds the PostgreSQL tables with the most dead rows and shows when they were last cleaned.26 Feb 2026 - Tip
\watch 2Psql \watch repeats a query every few seconds so you can watch a database jobReruns the last PostgreSQL query at a fixed interval inside psql.24 Feb 2026 - Tip
pg_dump -Fc -f appdb.dump appdbpg_dump -Fc makes a compressed database dump that pg_restore can pick apartSaves a PostgreSQL database as a compressed archive from which you can restore only chosen parts.22 Feb 2026 - Tip
EXPLAIN (ANALYZE, BUFFERS) UPDATE orders SET paid = true WHERE id = 42;EXPLAIN (ANALYZE, BUFFERS) shows what a PostgreSQL database query really didRuns a PostgreSQL statement and reports real timings and cache reads for each plan step.22 Feb 2026 - Tip
find /srv /etc -xtype l -lsfind -xtype l lists symlinks that point to nothingLists symbolic links whose target no longer exists.21 Feb 2026 - Tip
find . -regextype posix-extended -iregex '.*\.(jpe?g|png|gif)$'find -regextype posix-extended -regex matches several names in one testMatches file paths with one regular expression instead of several -name tests.19 Feb 2026 - Tip
find /etc -maxdepth 1 -type f -name '*.conf'find -maxdepth 1 searches one folder without going into the subfoldersLimits how many directory levels find goes down.19 Feb 2026 - Tip
find . -mindepth 1 -type d -emptyfind -type d -empty lists the folders with nothing in themLists empty files and empty directories under a path.18 Feb 2026 - Tip
find /srv -type f -printf '%s\t%p\n' | sort -nr | head -n 10find -printf with sort shows the biggest files without using lsPrints byte sizes and paths so you can sort and find the largest files.18 Feb 2026 - Tip
ls -l report.odt # -rw-r-----+A plus sign after the permissions in ls -l means an ACL adds more rulesShows how to spot extra access rules that ls -l hides behind a plus sign.11 Feb 2026 - Tip
chmod g=u,o= notes.txtchmod g=u gives the group the same permissions as the ownerCopies the owner's permission bits to the group and clears them for others.10 Feb 2026 - Tip
idid shows the groups you have now, so new permissions need a new loginCompares the groups of the current session with the groups stored for the account.7 Feb 2026 - Tip
chmod 711 /tmp/demoDirectory permissions 711 let users enter a folder but not list itExplains the directory execute and read bits, and how 711 allows access without listing.6 Feb 2026 - Tip
DEVICESCAN -a -m root -s (S/../.././02|L/../../6/03)Smartd runs smart self-tests on a schedule and mails you the warningsLets the smartd daemon test drives on a schedule and mail you the warnings.4 Feb 2026
Storage104
- Tip
dpkg --verify openssh-serverdpkg --verify lists files of installed packages that changed on diskChecks installed package files against the md5sums dpkg stored at install time.3 Dec 2026 - Tip
lsscsi -slsscsi -s lists your disks with their sizesLists SCSI-layer devices such as disks with capacity, in one line each.2 Dec 2026 - Tip
rsync -a --files-from=list.txt /home/me/ backup:/backup/rsync --files-from copies exactly the files you listReads the list of files to transfer from a text file or from standard input.2 Dec 2026 - Tip
rsync -a --delete --backup-dir=/backups/old-2026-12-01 /data/ /backups/current/rsync --backup-dir keeps the old version of every file it replacesMoves files that rsync overwrites or deletes into a separate folder instead of losing them.2 Dec 2026 - Tip
rsync -av --ignore-existing photos/ nas:/photos/rsync --ignore-existing never touches a file that is already at the destinationSkips every file that already exists on the receiving side, even if the source copy is newer.2 Dec 2026 - Tip
rsync --partial --progress big-file.iso nas:/isos/rsync --partial keeps a half-copied file so the next run can continueKeeps partially transferred files after an interruption instead of deleting them.2 Dec 2026 - Tip
borg mount /path/to/repo /mnt/borgborg mount lets you browse an archive like a normal folderMounts a Borg repository or archive as a filesystem so you can copy files out.2 Dec 2026 - Tip
snap savedsnap removal keeps a copy of the app data unless you purge itSkip the automatic snapshot when you are sure the data can go.1 Dec 2026 - Tip
wsl --terminate UbuntuExporting a WSL distro packs your Windows setup into one tar fileSave a whole WSL distribution to a tar file you can import again.1 Dec 2026 - Tip
ls -lhS /var/logls -lhS puts the biggest files in a folder at the topSort a directory listing by size, with readable units.1 Dec 2026 - Tip
find /backup -name '*.gz' ! -exec gzip -t {} \; -print 2>/dev/nullfind ! -exec gzip -t lists the archives that are brokenUses a command's exit status inside find to keep only the files that fail a check.30 Nov 2026 - Tip
apt list '~c'apt purge '~c' removes the config leftovers of packages you already removedCleans out packages that are gone but still left their configuration behind.30 Nov 2026 - Tip
udisksctl power-off -b /dev/sdXudisksctl power-off makes a USB disk safe to unplugFlushes, detaches and powers down a USB disk from the terminal, like ejecting it in a file manager.30 Nov 2026 - Tip
find /srv/data -depth -printfind -depth lists a folder's contents before the folder itselfChanges find's order so files come before their folder, which some copy and delete jobs need.30 Nov 2026 - Tip
du -sh -- .[!.]* * 2>/dev/null | sort -hdu -sh * skips hidden folders, and they can hold half your diskIncludes dot folders like .cache in a du overview, where the usual glob leaves them out.30 Nov 2026 - Tip
dig +search nasdig +search uses your search domains, which dig skips by defaultMake dig resolve a short host name the way your system does, through the search list.30 Nov 2026 - Tip
env -i ./backup.shenv -i runs a command with an empty environment, like cron and systemd doReproduce the 'works in my shell, fails in cron' problem on purpose.30 Nov 2026 - Tip
ls -l /dev/disk/by-id//dev/disk/by-id gives a disk a name that never changesUses a name based on model and serial number instead of sda or sdb, which can swap after a reboot.30 Nov 2026 - Tip
e2label /dev/sdX1 backup2e2label gives an ext4 disk a name you can mount it bySets a readable label on an ext4 filesystem and uses that label in fstab.30 Nov 2026 - Tip
du -h -t 1G /srv | sort -hdu -t 1G shows only the folders that are bigger than a size you pickHide the hundreds of small folders and see only the ones worth cleaning up.30 Nov 2026 - Tip
stat -f /srvstat -f shows block size and free inodes of the disk under a pathPrints filesystem details like type, block size and free inodes for any folder.30 Nov 2026 - Tip
@daily /usr/local/bin/backup.sh@daily and @weekly in a crontab replace the five time fieldsUses readable shortcuts like @daily instead of five numbers for common cron schedules.30 Nov 2026 - Tip
sed -n '/BEGIN backup/,/END backup/p' /var/log/app.logsed -n '/start/,/end/p' prints the block between two lines on LinuxPull one section out of a config or log, from a start line to an end line.30 Nov 2026 - Tip
resize2fs /dev/sdX1resize2fs makes an ext4 filesystem use a disk you just made biggerGrows an ext4 filesystem to fill its enlarged disk or partition, often while it stays mounted.30 Nov 2026 - Tip
du -ch /var/log/*.log | tail -n 1du -ch adds up the disk space of only the files you pickGives one total for a set of matching files, like all logs or all ISO images.30 Nov 2026 - Tip
du -sh --exclude=node_modules --exclude='*.iso' ~/projectsdu can leave whole patterns out of a disk usage totalMeasures a folder without the parts you don't care about, like ISO files or node_modules.30 Nov 2026 - Tip
cat /sys/block/sda/queue/scheduler/sys/block/sda/queue/scheduler shows and switches the Linux I/O scheduler of a diskSee which I/O scheduler a disk uses and try another one without a reboot.30 Nov 2026 - Tip
mount -o loop,ro backup.img /mnt/imgmount -o loop,ro opens a disk image or ISO without writing to itMounts an image file as a read-only folder, so you can copy files out of it safely.30 Nov 2026 - Tip
cp -al photos photos-before-cleanupcp -al makes an instant copy of a folder tree that takes almost no spaceCopy a big folder in seconds as hard links, as a quick snapshot before you change things.30 Nov 2026 - Tip
0 3 * * * chronic /usr/local/bin/backup.shChronic keeps a cron job quiet until it failsHides the output of cron jobs that succeed, so the mails you get always mean something.30 Nov 2026 - Tip
if ! mountpoint -q /mnt/backup; thenMountpoint -q tells a script whether a folder is really mountedReturns success only when a folder is a mount point, so scripts can check first.28 Nov 2026 - Tip
restic -r /srv/restic-repo check --read-data-subset=10%restic check --read-data-subset=10% reads a slice of your backup to prove it is intactVerifies a random or numbered slice of your restic repository by reading the actual data files.28 Nov 2026 - Tip
restic -r /srv/restic-repo forget --keep-daily 5 --dry-runrestic forget --keep-daily 5 --dry-run shows which snapshots would goPreviews which restic snapshots a retention policy would delete without removing anything.28 Nov 2026 - Tip
restic -r /srv/restic-repo mount /mnt/resticrestic mount lets you browse your snapshots as a normal folderMounts a restic repository through FUSE so you can browse and copy files from every snapshot.28 Nov 2026 - Tip
restic -r /srv/restic-repo restore latest --target /tmp/restore --include /mnt/user/appdata/<app>/config.xmlrestic restore --include brings back one file from a snapshotRestores a single file or folder from a restic snapshot into a directory of your choice.28 Nov 2026 - Tip
restic -r /srv/restic-repo dump latest /mnt/user/appdata/<app>/config.xml > config.xmlrestic dump prints a file from a snapshot, so you can pipe it straight onWrites a file or folder from a restic snapshot to stdout, ready for a pipe or redirect.28 Nov 2026 - Tip
restic -r /srv/restic-repo backup /mnt/user/appdata --dry-run -vvrestic backup --dry-run -vv lists what a backup would add before it writesShows which files a restic backup would process, so you can test your excludes without making a snapshot.28 Nov 2026 - Tip
restic -r /srv/restic-repo backup /mnt/user/appdata --exclude-if-present .nobackuprestic backup --exclude-if-present .nobackup skips folders you markMakes restic skip any folder that contains a marker file you chose, such as .nobackup.28 Nov 2026 - Tip
restic -r /srv/restic-repo backup --one-file-system /restic backup --one-file-system keeps mounted disks out of a backup of /Keeps restic from crossing into other mounted filesystems when you back up a directory tree.28 Nov 2026 - Tip
restic -r /srv/restic-repo-copy copy --from-repo /srv/restic-reporestic copy duplicates snapshots into a second repositoryCopies snapshots from one restic repository into another, for example to keep an offsite second copy.28 Nov 2026 - Tip
borg compact /path/to/repoborg compact is what actually frees the space after you prune or deleteFrees the repository space that borg prune only marks as unused.28 Nov 2026 - Tip
borg prune -v --list --dry-run --keep-daily=7 --keep-weekly=4 /path/to/repoborg prune --list --dry-run shows what a retention rule would deletePreviews which borg archives a prune rule keeps and removes, without changing the repository.28 Nov 2026 - Tip
borg check --verify-data /path/to/repoborg check --verify-data re-verifies the actual data in your archivesVerifies the stored data of your Borg archives instead of only their structure.28 Nov 2026 - Tip
borg create --list --filter=AME /path/to/repo::{hostname}-{now} ~/Documentsborg create --list --filter=AME shows only new, changed and unreadable filesLists only the added, modified and unreadable files in a Borg backup run.28 Nov 2026 - Tip
rsync -av --delete --max-delete=50 /mnt/user/photos/ [email protected]:/mnt/user/backup/photos/rsync --max-delete stops a mirror that suddenly wants to delete too muchCaps how many files rsync may delete in one run, and exits with an error when the limit is hit.28 Nov 2026 - Tip
rclone sync --interactive /mnt/user/appdata/<app> remote:current --backup-dir remote:oldrclone sync --backup-dir moves overwritten and deleted files aside instead of losing themKeeps the files a sync would overwrite or delete in a separate folder on the same remote.28 Nov 2026 - Tip
rclone sync /mnt/user/appdata/<app> remote:backup --max-delete 50rclone --max-delete stops a sync that wants to remove too many filesMakes rclone stop with an error when a sync would delete more files than the limit you set.28 Nov 2026 - Tip
borg diff /path/to/repo::archive1 archive2borg diff shows what changed between two Borg archivesLists files added, removed and changed between two archives in a Borg repository.28 Nov 2026 - Tip
30 2 * * * /usr/local/bin/nightly-backup.shA cron job at 02:30 can be skipped or run twice when the clocks changeExplains why jobs at 02:30 can be skipped or run twice when the clocks change, and how to avoid it.28 Nov 2026 - Tip
findmnt --dffindmnt --df gives you df output without the pseudo filesystemsShow mounted filesystems in a df-style table, minus the pseudo filesystems.28 Nov 2026 - Tip
rclone copy --immutable /mnt/user/appdata/<app>/exports remote:archiverclone copy --immutable refuses to overwrite or delete anything at the destinationMakes an rclone copy add new files but never overwrite or delete the ones already at the destination.28 Nov 2026 - Tip
borg extract --dry-run /path/to/repo::my-filesborg extract --dry-run proves an archive can be restored without writing a fileReads, verifies and decrypts an archive as if restoring it, but writes no files to disk.28 Nov 2026 - Tip
cat /proc/pressure/cpu/proc/pressure shows how long tasks wait for CPU, memory or diskShows the share of time tasks stall on CPU, memory or disk, over 10, 60 and 300 seconds.28 Nov 2026 - Tip
logger -t backup "nightly sync finished"logger -t lets a script write its own lines to the system logWrites a tagged message from a script to the system log so you can find it later.28 Nov 2026 - Tip
borg check --repository-only --max-duration=3600 /path/to/repoborg check --max-duration splits a long repository check over several daysRuns a Borg repository check in time-limited pieces that resume where the last one stopped.28 Nov 2026 - Tip
df -h --output=source,fstype,size,used,avail,pcent,targetdf --output picks exactly the columns you want, including inode usagePrints only the columns of df that you list, such as mount point, percentage and inode use.28 Nov 2026 - Tip
du -h -d1 --time --time-style=long-iso ~/Downloads | sort -hdu --time shows when each folder was last touchedAdds the date of the latest change to each folder in a du listing.28 Nov 2026 - Tip
zstd -b1 -e19 app-backup.tarzstd -b1 -e19 benchmarks every compression level on your own fileMeasures ratio and speed of each zstd level on your data, so you can pick one.27 Nov 2026 - Tip
tar -cf - /mnt/user/appdata/app | gzip --rsyncable > /backup/app.tar.gzGzip --rsyncable lets rsync send only the changed part of a compressed backupKeeps a compressed backup rsync-friendly, so a small change means a small transfer.27 Nov 2026 - Tip
UUID=<root-uuid> / ext4 defaults 0 1The last number on an fstab line decides whether fsck checks that diskExplains the sixth fstab column, which decides whether a disk gets a filesystem check at boot.27 Nov 2026 - Tip
UUID=<your-uuid> /mnt/backup ext4 noauto,user 0 0The user option in fstab lets you mount a disk without sudoLets a normal user mount and unmount one disk from fstab without root.27 Nov 2026 - Tip
mkdir -p ~/config-exportcp --parents copies a file and rebuilds its folder path at the destinationCopies files into a target folder while keeping the directory path they came from.27 Nov 2026 - Tip
cp --reflink=always vdisk1.img vdisk1-before-update.imgcp --reflink=always makes an instant copy on Btrfs and XFS, or failsClones a big file in an instant on filesystems that support copy on write.27 Nov 2026 - Tip
maxsize 100Mmaxsize makes logrotate rotate a log early when it grows too fastRotate a log on its normal schedule and also as soon as it passes a size.27 Nov 2026 - Tip
printf 'Signature: 8a477f597d28d172789f06886806bc55' > /mnt/user/appdata/app/cache/CACHEDIR.TAGTar --exclude-caches skips every folder marked with a CACHEDIR.TAGLeaves cache folders out of a tar backup by marking them with one small file.27 Nov 2026 - Tip
tar -czf /backup/docs-0.tar.gz -g /backup/docs.snar /home/user/docstar -g keeps a snapshot file so the next backup only holds what changedMakes tar backups that only contain the files that changed since the previous run.27 Nov 2026 - Tip
restic -r sftp:[email protected]:/restic-repo snapshotsrestic diff shows what changed between two backup snapshotsLists the files that were added, removed or changed between two restic snapshots.27 Nov 2026 - Tip
restic -r sftp:[email protected]:/restic-repo unlockrestic unlock clears the stale lock an interrupted backup leaves behindRemoves the stale lock that keeps a restic repository blocked after an interrupted run.27 Nov 2026 - Tip
truncate -s 10G test.imgdu --apparent-size explains why ls and du disagree about a fileShows the size a file claims to be next to the space it really uses on disk.27 Nov 2026 - Tip
rsync -a --mkpath photos/2026/ [email protected]:/mnt/user/backup/photos/2026/rsync --mkpath creates the missing folders at the destinationLets rsync create every missing folder of the destination path, like mkdir -p.27 Nov 2026 - Tip
rsync -av --remove-source-files ~/Downloads/done/ [email protected]:/mnt/user/media/incoming/rsync --remove-source-files moves files instead of copying themCopies files to another machine with rsync and deletes each one once it safely arrived.27 Nov 2026 - Tip
rsync -a --link-dest=../2026-11-25 /src/ /backup/2026-11-26/rsync --link-dest makes daily backup snapshots that only cost the changed filesMakes full daily backup folders where unchanged files are hard links, so they take almost no space.26 Nov 2026 - Tip
/mnt/user/MediaNever create two Unraid shares whose names differ only in capitalsAvoid duplicate Unraid shares that only differ in uppercase and lowercase letters.25 Nov 2026 - Tip
100GClick the Capacity field to grow a VM vdisk in UnraidGive a VM that ran out of space a bigger disk without rebuilding it.25 Nov 2026 - Tip
qemu-img convert -p -O raw /dev/sdX /mnt/user/domains/oldpc/vdisk1.imgqemu-img convert turns an old physical disk into an Unraid vdiskMove an old physical Linux or Windows install into a VM on Unraid.25 Nov 2026 - Tip
pv backup.tar.gz | tar xzpv puts a progress bar on anything you pipeShows progress, speed and time left for data going through a pipe.25 Nov 2026 - Tip
lsblk -d -o NAME,SIZE,ROTA,MODELlsblk -d -o NAME,ROTA tells an SSD from a spinning diskShows with one column whether each drive is a spinning disk or flash storage.24 Nov 2026 - Tip
dpkg -S /usr/bin/digdpkg -S finds the apt package that owns a file on diskTells you which installed package a given file belongs to.24 Nov 2026 - Tip
17 2 * * * root /usr/local/bin/backup.shA file in /etc/cron.d needs a user field that a personal crontab does not haveExplains the extra user column that system crontab files in /etc/cron.d require.24 Nov 2026 - Tip
df -hTdf -hT shows the filesystem type next to every mountAdds a column with the filesystem type, so you see what is on each mounted disk.23 Nov 2026 - Tip
rsync -ah --info=progress2 /source/ /destination/rsync --info=progress2 shows one progress line for the whole copyShows a single progress line for the whole transfer instead of one per file.21 Nov 2026 - Tip
du -sh * 2>/dev/null | sort -hdu -sh * | sort -h shows what is eating your disk, biggest lastLists every folder in the current directory with its size, sorted so the biggest ones are at the bottom.18 Nov 2026 - Tip
watch -n 2 'df -h /mnt/user'watch -n 2 runs a command every two seconds and shows the latest outputRepeats any command at a set interval, so you can watch a number change without retyping it.1 Nov 2026 - Tip
timeout -k 5 30 ./backup.shtimeout stops a command that hangsStops a command after a set time, and force-kills it if it will not quit.23 Oct 2026 - Tip
watch -d -n 5 'df -h /mnt/backup'watch -d highlights what changed between refreshesReruns a command every few seconds and highlights the parts that changed.1 Oct 2026 - Tip
getent hosts nas.localgetent hosts shows what your programs really resolveShows the address a normal program gets, including hosts file entries that dig ignores.16 Sep 2026 - Tip
cp /boot/config/go /boot/config/go.bak/boot/config/go runs your own commands at every bootExplains the script on the flash drive that runs your own commands each time Unraid starts.21 Aug 2026 - Tip
tail -f /var/log/syslogWhen the array will not stop, find out what still has a disk openLists the commands that show which process keeps a disk busy so the array cannot stop.18 Aug 2026 - Tip
lsblk -flsblk -f shows filesystems, labels and UUIDs in one viewShows every disk and partition with its filesystem type, label, UUID and mount point.25 Jul 2026 - Tip/mnt/user0 is the array-only view of your shares, but it is deprecatedExplains what /mnt/user0 shows and why you should not build new scripts on it.21 Jul 2026
- Tip
ls -l /mnt/disk*/Media/film.mkv 2>/dev/nullFind the disk that holds a file with ls on /mnt/disk*Shows on which array disk a file from a user share physically sits.2 Jul 2026 - Tip
nice -n 19 ionice -c3 tar -czf /backup/www.tar.gz /var/wwwnice and ionice keep a heavy linux job out of everyone's wayRuns a heavy command with the lowest CPU and disk priority.28 May 2026 - Tip
iostat -xz 1iostat -xz 1 shows how busy each disk is, once per secondPrints per-disk utilisation and wait times every second to show whether storage is the bottleneck.17 May 2026 - Tip
df -i /vardf -i shows a full disk that still has free gigabytesShows how many inodes are used on each filesystem, which explains a disk that is full with free space left.17 May 2026 - Tip
crontab -l > ~/crontab.backupcrontab -r deletes every cron job without asking, so run crontab -l firstSaves your crontab to a file and makes crontab ask before it removes everything.1 May 2026 - Tip
0 3 * * * tar czf /backup/home-$(date +%F).tgz /homeA % in a cron command must be written as \% or the line breaksExplains why a percent sign inside a crontab line cuts the command short and how to escape it.27 Apr 2026 - Tip
rsync -a --bwlimit=20M /srv/data/ backup:/srv/data/rsync --bwlimit=20M stops a linux copy from flooding the linkLimits how fast rsync transfers data, so other traffic keeps working.12 Apr 2026 - Tip
sqlite3 app.db ".backup /backup/app-$(date +%F).db"sqlite3 .backup copies a live database safely where cp can catch it half-writtenMakes a consistent copy of a SQLite database file while it is still in use.27 Feb 2026 - Tip
\dt+Psql \dt+ lists database tables with their size on diskShows disk usage per table, index and database from the psql prompt.25 Feb 2026 - Tip
pg_dump -Fd -j 4 -f /backup/appdb.dir appdbpg_dump -j dumps a large database in parallel, but only in directory formatSpeeds up PostgreSQL dumps and restores by processing several tables at once.22 Feb 2026 - Tip
mysqldump --single-transaction --routines --events mydb | gzip > mydb.sql.gzmysqldump --single-transaction takes a consistent database backup without lockingDumps a MySQL or MariaDB database from one consistent snapshot so applications can keep writing during the backup.21 Feb 2026 - Tip
find . -type f -newermt '2026-11-01' ! -newermt '2026-11-08'find -newermt gives you the files changed between two datesLists the files modified inside a date range, without a reference file.17 Feb 2026 - Tip
find /etc -type f -newer /tmp/before-upgradefind -newer lists everything changed since a reference fileLists the files modified after the moment of a reference file.16 Feb 2026 - Tip
find /backup -type f -mtime +7 -printfind -mtime +7 means at least eight days old, because fractions are droppedExplains how find rounds ages in days and how to get a finer cut-off in minutes.16 Feb 2026
Network56
- Tip
certbot renew --dry-runcertbot renew --dry-run tests your renewal before it mattersRehearses a Let's Encrypt renewal against the staging server without saving any certificate.3 Dec 2026 - Tip
bridge fdb show br br0bridge fdb show lists which MAC address sits behind which bridge portPrints the forwarding table of a Linux bridge, so you can see where a MAC address lives.3 Dec 2026 - Tip
printf 'key=1\nport=80\n' | sed '/^port=/a timeout=5'Sed '/pattern/a text' adds a new line after every matching lineInserts a line of text after each line that matches a pattern.2 Dec 2026 - Tip
watch -e -n 5 curl -fsS -o /dev/null https://example.com/healthwatch -e freezes on the first error so you can still read itStop refreshing as soon as the watched command fails.1 Dec 2026 - Tip
ip -br linkNetplan match and set-name give a network card a name that stays putRename an interface by its MAC address so the config keeps pointing at it.1 Dec 2026 - Tip
tail -f /var/log/nginx/access.log /var/log/nginx/error.logtail can follow several files at once and label each blockWatch more than one log in a single terminal window.1 Dec 2026 - Tip
rfkill listrfkill list shows whether Wi-Fi or Bluetooth is blocked by software or hardwareFind out why a radio refuses to turn on.1 Dec 2026 - Tip
if curl -fsS https://example.com/health | jq -e '.status == "ok"' >/dev/null; thenJq -e sets the exit code, so a shell if can test a valueUse a jq check directly in an if statement or a health check script.30 Nov 2026 - Tip
vim +/listen /etc/nginx/nginx.confvim +/pattern opens a file at the first matchStarts Vim with the cursor on a line or search match.30 Nov 2026 - Tip
ping -O -D 192.0.2.1ping -O -D shows exactly when a Linux network connection drops repliesLog each missing reply with a timestamp, so short outages become visible.30 Nov 2026 - Tip
tc qdisc add dev eth0 root netem delay 100mstc netem adds fake latency so you can test a slow network on LinuxMake a fast link behave like a slow or lossy one to see how your app copes.30 Nov 2026 - Tip
apt show nginxapt show tells you what a package is before you install itPrints a package's description, size, dependencies and source repository.30 Nov 2026 - Tip
ss -xlpss -x lists the Unix sockets that never show up as a port on LinuxFind which process listens on a local socket file, like the Docker or database socket.30 Nov 2026 - Tip
curl --xattr -O https://example.com/tools/file.tar.gzcurl can write the download URL into the file itselfStore where a file came from in its extended attributes, so you can look it up later.30 Nov 2026 - Tip
sed '0,/^port=/s//port=8081 #/' app.confsed '0,/old/s//new/' changes only the first match in a whole fileReplace the first occurrence in a file and leave every later one alone.30 Nov 2026 - Tip
vimdiff nginx.conf nginx.conf.newvimdiff shows two files side by side and Vim copies changesCompares two files and moves differences between them.30 Nov 2026 - Tip
ethtool -p eth1 10ethtool -p blinks the LED of a network port so you can find it in the rackMake the port light blink so you know which physical socket belongs to eth1.30 Nov 2026 - Tip
options timeout:2 attempts:2 rotateoptions timeout and attempts in resolv.conf decide how long a Linux DNS failure takesShorten the wait when the first name server in resolv.conf is down.30 Nov 2026 - Tip
ss -tno state establishedss -o shows the keepalive and retransmit timers of each Linux TCP connectionSee whether a connection is waiting on keepalive, retransmits or a closing timer.30 Nov 2026 - Tip
ethtool -i eth0ethtool -i shows the driver and firmware version behind a Linux network portFind out which driver and firmware a network card uses before you search for a bug.30 Nov 2026 - Tip
socat TCP-LISTEN:8080,fork,reuseaddr TCP:127.0.0.1:3000socat forwards a TCP port to another address on Linux in one commandExpose a service on another port or address for a quick test, no proxy config needed.30 Nov 2026 - Tip
ss -sss -s counts your sockets before you list themPrints totals of open sockets per protocol and TCP state in a few lines.28 Nov 2026 - Tip
resolvectl query -4 --legend=no example.comresolvectl query --legend=no prints only the answerPrints resolvectl lookup results without headers, so scripts get only the answers.28 Nov 2026 - Tip
nmcli connection modify "Cafe Wifi" 802-11-wireless.cloned-mac-address randomNetworkManager can use a random MAC address every time you join a Wi-Fi networkMakes NetworkManager use a random or per-network MAC address for a Wi-Fi connection.28 Nov 2026 - Tip
resolvectl dns eth0 192.168.1.53resolvectl revert undoes the DNS settings you changed by hand on a linkResets the DNS settings of one network interface back to its defaults.28 Nov 2026 - Tip
unbound-checkconf /etc/unbound/unbound.confRun unbound-checkconf before you restart UnboundChecks an Unbound config file for errors before you restart the resolver.28 Nov 2026 - Tip
dnsmasq --testdnsmasq --test checks the config and exits without startingSyntax-checks the dnsmasq configuration and exits without starting the server.28 Nov 2026 - Tip
named-checkzone example.com /etc/bind/db.example.comnamed-checkzone catches zone file mistakes before the name server loads themValidates a BIND zone file the way the name server would, before you reload it.28 Nov 2026 - Tip
cp --backup=numbered nginx.conf /etc/nginx/nginx.confcp --backup=numbered keeps the file you were about to overwriteSaves every overwritten file as a numbered copy, so you can always go back.27 Nov 2026 - Tip
After=network-online.targetWants= plus After=network-online.target makes a service wait for a working networkMakes a service start only once the network is really up, not just started.27 Nov 2026 - Tip
ip -ts monitor label link address routeip monitor prints network changes the moment they happenStreams link, address and route changes live, so short network hiccups leave a trace.27 Nov 2026 - Tip
ip -s -s link show eth0ip -s link shows the errors and drops on a network interfaceShows per-interface error and drop counters so you can spot a bad cable or port.27 Nov 2026 - Tip
ss -tin dst 192.168.1.30ss -ti shows the round trip time of every open TCP connectionShows round trip time, MTU and congestion window for each TCP connection to a host.27 Nov 2026 - Tip
ignoreip = 127.0.0.1/8 ::1 192.168.1.0/24 100.64.0.0/10ignoreip in jail.local stops fail2ban from banning your own networkKeeps fail2ban from banning addresses on your own LAN or tailnet.27 Nov 2026 - Tip
ping -M do -s 1472 -c 3 example.comping -M do -s 1472 finds the path MTU without fragmentationSends pings with the don't-fragment flag set, so you can find the largest packet that passes.25 Nov 2026 - Tip
diff -u nginx.conf.bak nginx.confdiff -u gives a compact change list that patch and git understandCompares two files and prints only the changes, with a few lines of context, in the format patch tools expect.24 Nov 2026 - Tip
apt-cache madison nginxapt-cache madison lists every version a repository offersLists all available versions of a package and the repository for each.24 Nov 2026 - Tip
dig -p 5335 @127.0.0.1 example.com +shortdig -p queries a resolver that listens on another portQueries a DNS server that runs on a port other than 53.24 Nov 2026 - Tip
dig +noall +answer example.com Adig +noall +answer prints only the answer sectionPrints full record lines without the header, question and statistics blocks.24 Nov 2026 - Tip
curl -C - -O https://example.com/big.isocurl -C – resumes an interrupted download where it stoppedContinues a partly downloaded file from its current size instead of restarting.24 Nov 2026 - Tipss -tulpn shows which program is listening on which portShows which program is using which network port, useful when a port is already taken.16 Nov 2026
- Tip
tailscale file cp ./my-file.txt my-phone:Send a file to your phone with tailscale file cp, no cloud in betweenSends a file straight from your computer to your phone over Tailscale, no cloud in between.9 Nov 2026 - Tip
tail -F /var/log/nginx/access.logtail -F keeps following a log after logrotate renames itFollows a log file by name so it keeps working after the file is rotated.8 Oct 2026 - Tip
curl -sS -o /dev/null -w '%{http_code} %{time_total}s\n' https://example.comcurl -w prints the status code and timing and nothing elsePrints only the HTTP status code and response time of a URL.17 Sep 2026 - Tip
resolvectl dns wg0 10.0.0.1A route-only domain gives you split DNS in one commandSends DNS queries for one domain to a VPN's DNS server and leaves the rest alone.4 Sep 2026 - Tip
dig -x 9.9.9.9 +shortdig -x turns an IP address back into a nameLooks up the hostname that belongs to an IP address (reverse DNS).22 Jun 2026 - Tip
apt policy nginxapt policy tells you which version you get and where it comes fromShows the installed version, the candidate version and which repository each comes from.17 Jun 2026 - Tip
cd /var/log/nginxcd – takes you back to the last directorySwitches back to the directory you were in before the last cd.8 Jun 2026 - Tip
dig +short example.comdig +short gives you just the answerPrints only the answer data from a DNS lookup, without headers or statistics.7 Jun 2026 - Tip
ss -tn state established '( dport = :443 )'ss state established filters linux connections by state and portLists only the TCP connections in a chosen state that match a port, instead of every socket.27 May 2026 - Tip
network: {version: 2, ethernets: {enp3s0: {}}, vlans: {vlan20: {id: 20, link: enp3s0, addresses: [10.20.0.5/24]}}}Netplan vlans need an id and a link to a parent interfaceAdds a tagged VLAN interface on top of a physical port in netplan.13 May 2026 - Tip
network: {version: 2, ethernets: {enp3s0: {}}, bridges: {br0: {interfaces: [enp3s0], dhcp4: true}}}Netplan bridges move the IP address from the NIC to the bridgeBuilds a bridge in netplan and gives the address to the bridge.13 May 2026 - Tip
tr '\0' '\n' < /proc/$(pgrep -o nginx)/environ | sorttr on /proc/PID/environ shows the environment of a running linux processPrints the variables a running process was started with, one per line.9 Apr 2026 - Tip
fastcgi_cache WP;Nginx fastcgi_cache plus X-Cache-Status shows whether PHP pages come from cacheAdds a response header that tells you if nginx answered from its FastCGI cache.5 Apr 2026 - Tip
wp plugin list --status=active --url=https://shop.example.comThe --url flag points wp-cli at one wordpress site of a multisite networkSelects which site of a multisite network a WP-CLI command should run on.31 Mar 2026 - Tip
scutil --get ComputerNamescutil --get shows the three names your macos machine uses on the networkPrints the computer name, Bonjour name and hostname that macOS keeps separately.5 Mar 2026
Docker30
- Tip
docker network prunedocker network prune --filter label!= spares the networks you markRemoves unused Docker networks, optionally only old ones or only ones without a label.3 Dec 2026 - Tip
docker run --rm --sysctl net.ipv4.ip_forward=1 alpine cat /proc/sys/net/ipv4/ip_forwarddocker run --sysctl sets a kernel parameter for one container onlyChanges a namespaced kernel setting inside a single container, without touching the host's settings.2 Dec 2026 - Tip
getent group sudo adm docker lxdgetent group sudo lists everyone with admin rights, a two second security checkShows which accounts are in the groups that grant sudo or root access.30 Nov 2026 - Tip
docker run --rm --user "$(id -u):$(id -g)" \docker run with your own user ID stops root-owned files in your foldersRun a one-off container as yourself so the files it writes are yours.30 Nov 2026 - Tip
docker run --rm alpine cat /proc/sys/net/ipv4/ip_unprivileged_port_startA non-root Docker container can already listen on port 80Docker sets a sysctl so container users can bind ports below 1024.30 Nov 2026 - Tip
jq -r '.[] | [.name, .mem] | @tsv' containers.json | sort -t$'\t' -k2 -n | column -tjq @tsv turns API output into columns for cut, sort and awkFlatten records into tab separated lines that classic text tools can handle.30 Nov 2026 - Tip
docker info --format '{{json .Warnings}}'Read the warnings at the end of docker info after installing DockerSpot missing kernel features that silently disable memory limits or networking.30 Nov 2026 - Tip
ls -ln /srv/datals -n shows owners as numbers, which explains odd permissions on shares and containersPrints UIDs and GIDs instead of names, so mismatched IDs become visible.30 Nov 2026 - Tip
sudo gpasswd -d alice dockerGpasswd -d removes a user from one group and leaves the rest of their permissions aloneTakes one user out of one group without touching other memberships.30 Nov 2026 - Tip
ip netns add test1ip netns gives you a separate network stack on Linux to test inRun a command with its own interfaces and routes, apart from the rest of the system.30 Nov 2026 - Tip
sudo usermod -aG docker "$USER"Being in the docker group is the same as having rootTreat membership of the docker group like sudo without a password.30 Nov 2026 - Tip
capsh --printcapsh shows which capabilities a process has beyond normal permissionsLists the Linux capabilities of the current shell, including inside a container.30 Nov 2026 - Tip
docker run --ulimit nofile=1024:1024 --rm debian sh -c "ulimit -n"docker run --ulimit nofile raises the open files limit of one containerSets the soft and hard limit for open files of a single container.28 Nov 2026 - Tip
docker run -d --shm-size=1g <image>–shm-size gives a container a bigger /dev/shmRaises the size of /dev/shm inside a container, for programs that need more shared memory.28 Nov 2026 - Tip
docker run -d --stop-signal=SIGQUIT <image>–stop-signal chooses which signal docker stop sends firstSets the signal docker stop sends first, and shows how the grace period before SIGKILL works.28 Nov 2026 - Tip
expand -t 2 compose.yaml > compose.fixed.yamlexpand -t 2 turns tabs into spaces, for YAML files that refuse tabsConverts tab characters into spaces, so YAML files with tab indentation load again.27 Nov 2026 - Tip
docker ps -aq --filter status=exited | xargs -r docker rmXargs -r skips the command when there is no input at allStops xargs from running the command when the pipeline before it produced no input.27 Nov 2026 - Tip
find /mnt/user -name 'docker-compose.yml' -print -quitfind -print -quit stops searching after the first matchMakes find stop at the first matching file instead of searching the whole folder tree.27 Nov 2026 - Tip
sudo journalctl -b CONTAINER_NAME=webserverJournalctl CONTAINER_NAME= reads one Docker container's logs from the journalSends Docker container logs to the systemd journal and filters them by container name.27 Nov 2026 - Tip
journalctl -u docker -f -n 0journalctl -f -n 0 follows a log and prints only what arrives from now onFollows the journal and shows only new entries, without the usual last ten lines.26 Nov 2026 - Tip
docker container ls -sdocker container ls --size shows how much each container has writtenAdds a size column that shows how much data each container wrote on top of its image.24 Nov 2026 - Tip
docker top mycontainerdocker top lists the processes inside a container from the hostLists the processes running in a container without opening a shell inside it.24 Nov 2026 - Tip
systemctl list-dependencies --reverse docker.servicesystemctl list-dependencies --reverse shows what depends on a systemd unitShows which units depend on a given unit, before you stop or disable it.24 Nov 2026 - Tip
docker compose configRun docker compose config before you blame your compose filePrints the compose file as Docker really reads it, so you can find the mistake.1 Nov 2026 - Tip
environment:Run Nginx Proxy Manager as a normal user with PUID and PGIDRuns Nginx Proxy Manager as a regular user instead of root and fixes folder ownership.4 Sep 2026 - Tip
findmnt -T /var/lib/dockerfindmnt -T tells you which mount a path lives onPrints which mounted filesystem a given path lives on.6 Aug 2026 - Tip
sudo snap logs -f dockerSnap logs -f follows the output of a snap's servicesShows and follows the service logs of an installed snap.13 May 2026 - Tip
docker builder prune --filter until=72hdocker build --no-cache rebuilds every layer, builder prune clears the cacheForces a full rebuild without stored layers and removes old build cache entries by age.6 Apr 2026 - Tip
FROM alpine:3.20Portainer builds images from a Dockerfile in the browser, but COPY cannot see the hostBuilds a Docker image straight from the Portainer interface and shows the limits of COPY.9 Mar 2026 - Tip
docker exec -it -u root mycontainer /bin/ashThe portainer console needs /bin/ash on Alpine, or a custom commandOpens a shell inside a container from the browser and explains the Alpine exception.9 Mar 2026
Python11
- Tip
python3 -I -c 'import json; print(json.__file__)' # the real json modulepython -I runs a script without your local files or user packages getting inRun Python in isolated mode so the current folder and environment can't change imports.30 Nov 2026 - Tip
python3 -m platformpython -m platform tells you which OS and CPU a machine hasPrint the operating system, kernel and architecture of a machine in one command.30 Nov 2026 - Tip
sudo apt install python3-giA python venv with system site packages reuses what your OS already installedCreate a venv that can still see system wide packages like those from apt.30 Nov 2026 - Tip
import shutilPython's shutil.disk_usage reads free disk space without parsing dfGet total, used and free bytes for any mount point straight from Python.30 Nov 2026 - Tip
readlink -f /usr/bin/python3readlink -f follows every symlink and prints the real pathResolves a chain of symlinks and prints the real absolute path of the target.28 Nov 2026 - Tip
python3 -m sqlite3 app.db "SELECT count(*) FROM sqlite_master"python -m sqlite3 opens a SQLite shell when the sqlite3 binary is missingRuns SQL against a SQLite file from the python standard library, with no extra tools installed.24 Nov 2026 - Tip
python3 -m pytest --lfpython -m pytest --lf reruns only the tests that failed last timeReruns just the previously failing tests, or runs them first, so feedback arrives in seconds.24 Nov 2026 - Tip
uv run --with requests python -c "import requests; print(requests.__version__)"uv run --with gives a python one-off its own temporary packagesRuns python with extra packages in a disposable environment, without installing them anywhere permanent.24 Nov 2026 - Tip
uv python install 3.12uv python install fetches a python version without touching the systemDownloads and manages extra python versions per user, independent of the distribution package.24 Nov 2026 - Tip
python3 -m pip list --not-requiredpython -m pip list --not-required shows only what you installed yourselfLists only the top-level packages in an environment, hiding the ones pulled in as dependencies.24 Nov 2026 - Tip
python3 -m venv --upgrade-deps .venvpython -m venv --upgrade-deps starts a venv with a current pipCreates a virtual environment and upgrades pip in it immediately, so installs start from a current version.24 Nov 2026
Security6
- Tip
certbot certificatescertbot certificates lists every certificate and when it expiresShows each certificate Certbot manages, with its domains, expiry date and file paths.3 Dec 2026 - Tip
traceroute -T -p 443 -n example.comtraceroute -T follows the path with TCP packets where a firewall blocks the normal probesTrace the route to a web server with packets that a firewall lets through.30 Nov 2026 - Tip
mariadb-backup --backup --target-dir=/backup/full --user=root --passwordmariadb-backup copies the database files of a running server, and prepare makes them usableTakes a fast physical backup of a live MariaDB server instead of a slow SQL dump.30 Nov 2026 - Tip
chage -l <user>chage -l shows when a Linux password or account expiresShows the password and account expiry settings of a Linux user.28 Nov 2026 - Tip
borg key export /path/to/repo encrypted-key-backupborg key export saves the key you need to open a Borg repositoryExports the Borg encryption key to a file or paper, so a lost server doesn't lock you out.27 Nov 2026 - Tip
chage -l jordichage -l shows when an account's password or login expiresLists the password aging and expiry details of a user account.24 Nov 2026
Git4
- Tip
tar --exclude-vcs -czf project.tar.gz project/tar --exclude-vcs leaves .git folders out of an archiveLeaves .git and other version control folders out of a tar archive.3 Dec 2026 - Tip
diff -r -x .git -x '*.log' one twodiff -r -x skips folders and files you don't care aboutLeaves out files and folders matching a pattern when comparing two directories recursively.3 Dec 2026 - Tip
grep -rn --include='*.conf' --exclude-dir=.git 'listen' /etc/nginxgrep -r --include and --exclude-dir search only the files you care aboutLimits a recursive grep to certain file types and skips folders like .git.27 Nov 2026 - Tip
find . -type f -name '*.php' -not -path '*/vendor/*' -not -path './.git/*'find -not -path excludes a folder, and -name only sees the last partFilters out whole folders from the result by matching the full path.20 Feb 2026
Media3
- Tip
ssh -o StreamLocalBindUnlink=yes -L /tmp/app.sock:/run/app.sock hostssh StreamLocalBindUnlink fixes a forwarded socket that is already thereLets ssh replace a leftover Unix socket file when forwarding to a socket again.3 Dec 2026 - Tip
taskset -c 0,1 ffmpeg -i in.mkv out.mp4taskset shows and sets which CPU cores a process may useStarts a command on chosen CPU cores or changes the cores of a running process.28 Nov 2026 - Tip
resolvectl monitorresolvectl monitor streams every DNS query liveShows a live stream of the DNS lookups made on this machine.14 Aug 2026
Web3
- Tip
runuser -u www-data -- php /var/www/app/occ statusrunuser runs a command as another Linux user without a password or sudo ruleRun a command as a service account from a root script, without su or sudo prompts.30 Nov 2026 - Tip
mv -T --exchange /srv/site/html /srv/site/html-newmv --exchange swaps two files or folders in one atomic stepSwaps the names of two files or directories at once, with nothing in between.27 Nov 2026 - Tip
namei -l /var/www/html/uploads/photo.jpgnamei -l shows the permissions of every folder on the way to a filePrints the owner and mode of each folder in a path to find where access stops.13 Feb 2026
Mac2
- Tip
wakeonlan: trueWakeonlan: true in netplan, with the interface matched by MAC addressSwitches Wake on LAN on for an interface, which the docs say to match by MAC.2 Dec 2026 - Tip
diskutil list external physicaldiskutil list external physical shows plugged-in disks only, a macos safety stepLists only external physical drives so you pick the right disk before erasing.5 Mar 2026
Posts2
Nothing matches.