sed and awk command builder
Build a ready-to-run sed or awk command from a few options, with special characters escaped for you.
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.