Skip to content
100% local

sed and awk command builder

Build a ready-to-run sed or awk command from a few options, with special characters escaped for you.

Output

sed and awk command builder

Writing a correct sed or awk one-liner from memory means remembering delimiter escaping, GNU-versus-BSD flag differences and awk's field syntax. This tool builds the command for you: pick an operation, fill in a couple of plain-text fields, and copy a command that is already quoted and escaped for the shell.

Four operations cover the everyday cases. Substitute builds a find-and-replace sed command from a pattern and a replacement. Delete matching lines builds a sed command that removes every line containing a pattern. Select a column builds an awk command that prints one field from a delimited file, using the field separator and column number you choose. Print a line range builds a sed command that prints only the lines between a start and end line number. Case-insensitive matching, in-place editing, and combining several find/replace pairs or patterns into one command are all available as options. Switching between the GNU (Linux) and BSD (macOS) dialects changes the exact flags used — GNU's -i takes no argument, BSD's needs an explicit empty string, and GNU's case-insensitive I flag has no BSD equivalent.

Whatever you type into the pattern and replacement fields is escaped automatically, so periods, brackets, slashes, ampersands and backslashes are matched or inserted literally rather than read as regex syntax. Underneath the command, a small preview shows what it would do when run against a short sample, so you can check the result before copying it into a terminal.

Everything runs locally in your browser — the pattern, replacement and every other option stay on your device and are never uploaded anywhere. When the command looks right, copy it, download it as a .txt file, or send it to another tool's input to keep working.

FAQ

Does the pattern field use regular expressions?
No. Text you type in the pattern and replacement fields is escaped and matched literally, so characters like . * [ ] ^ $ and / are treated as themselves, not as regex syntax.
What's the difference between the GNU and BSD dialects?
In-place editing needs an empty argument after -i on BSD (macOS) sed but not on GNU (Linux) sed, and GNU's case-insensitive I flag has no portable BSD equivalent, so the tool leaves it out for that dialect.
How do I combine several find-and-replace pairs into one command?
Turn on "Multiple expressions" and write pairs in the pattern field separated by semicolons, each as find=>replace — the tool chains them with repeated -e flags.
Why does select-column need a separate awk command for in-place editing?
Editing a file in place is a GNU awk (gawk) extension; plain or BSD awk has no equivalent flag, so the tool builds a safe redirect through a temporary file instead.
Is my text uploaded anywhere?
No. The command is generated entirely in your browser — nothing you type is sent to a server.