🐚 Bash One-Liner Generator
Build common bash one-liners without memorizing the syntax. Pick a task, fill in the blanks, copy the command.
About this tool
A catalog of bash one-liners for the tasks developers reach for again and again — kill the process on a port, find the largest files in a directory, recursive find-and-replace, mirror a website, extract an archive, prune merged git branches. Pick a task, fill in the blanks, copy the command.
Example: pick "Kill the process listening on a port", enter 3000, and you get lsof -ti:3000 | xargs kill -9. Pick "Find the largest files in a directory", enter . and 20, and you get du -ah . | sort -rh | head -n 20.
Each command comes with a short explanation of what each piece does and a warning when an operation modifies files in place, so you understand the line before you paste it into a terminal.
FAQ
Are these commands safe to run? ›
Each entry explains what the command does and warns when it modifies files (e.g. find-and-replace with sed -i). Read the explanation first, and on commands flagged as in-place edits, test without the -i flag so you can preview the result.
Linux or macOS — do they work on both? ›
Yes for almost all entries. Where there is a meaningful difference (such as sed -i needing an empty backup suffix on macOS), the explanation notes it. Windows users should run these in WSL or Git Bash.
Why not just use ChatGPT for this? ›
You can. This tool exists for the dozen or so commands almost every developer ends up looking up repeatedly — having them as a fast, offline catalog with copy buttons is quicker than typing a prompt and waiting for an answer.