π¦ ClawHub
Linux
by @ivangdavila
Operate Linux systems avoiding permission traps, silent failures, and common admin mistakes.
TERMINAL
clawhub install linuxπ About This Skill
name: Linux description: Operate Linux systems avoiding permission traps, silent failures, and common admin mistakes. metadata: {"clawdbot":{"emoji":"π§","os":["linux","darwin"]}}
Linux Gotchas
Permission Traps
chmod 777 fixes nothing, breaks everything β find the actual owner/group issuechown -R follows symlinks outside target directory β use --no-dereferencegetfaclProcess Gotchas
kill sends SIGTERM by default, not SIGKILL β process can ignore itnohup doesn't work if process already running β use disown instead& still dies on terminal close without disown or nohupkill -9 skips cleanup handlers β data loss possible, use SIGTERM firstFilesystem Traps
lsof +L1rm -rf /path / with accidental space = disaster β use rm -rf /path/ trailing slashfind -L follows them/tmp cleared on reboot β don't store persistent data thereDisk Space Mysteries
lsof +L1 shows them, restart process to freetune2fs -m 1 to reducejournalctl --vacuum-size=500Mdocker system prune -aNetworking
localhost and 127.0.0.1 may resolve differently β check /etc/hostsiptables-save or use firewalld/ufw persistencenetstat deprecated β use ss insteadsetcap for capability insteadnet.ipv4.tcp_tw_reuseSSH Traps
ssh-keygen -RServerAliveInterval 60 to configSystemd
systemctl enable doesn't start service β also need startrestart vs reload: restart drops connections, reload doesn't (if supported)Storage=persistent in journald.confRestart=on-failure to unitAfter=network.target isn't enough β use network-online.targetCron Pitfalls
/dev/nullcrontab -l > backup before editingMemory and OOM
vmstatfree includes cache β "available" is what matters/proc/[pid]/status β VmRSS is actual usageCommands That Lie
df shows filesystem capacity, not physical disk β check underlying devicedu doesn't count sparse files correctly β file appears smaller than disk usageps aux memory percentage can exceed 100% (shared memory counted multiple times)uptime load average includes uninterruptible I/O wait β not just CPUtop CPU percentage is per-core β 400% means 4 cores maxed