Rewrite

Uncomment lines

Turn commented config lines into active lines in bulk.

What this template solves

This template is a focused landing page for uncomment-lines workflows where the same config directive is prefixed with # and needs to be enabled quickly.

Open the workspace with this template preloaded, then refine it for your own file and text pattern.

Sample input

# DB_HOST=localhost
# DB_PORT=5432
APP_ENV=prod

Prompt to start from

Uncomment lines that start with # in the config file

Expected command

sed 's/^#\s*//'

Tags

commentsrewriteconfiguncomment

Best for

  • Enable multiple commented options in env or ini files.
  • Activate sample nginx or app config blocks.
  • Convert documentation snippets into runnable examples.

How to use this template

  1. 1Check that the lines to enable all start with the same comment prefix.
  2. 2Use the uncomment-lines sed pattern as the starting command.
  3. 3Preview the rewritten text, then apply the in-place variant for your operating system.

Template FAQ

Can sed uncomment many config lines at once?

Yes. If the lines start with a consistent comment marker like `#`, a pattern such as `sed 's/^#\s*//'` can enable them in bulk. This works well for env files, ini files, and config snippets.

When should I use uncomment-lines instead of editing config by hand?

Use it when a repeated block of settings has to be enabled together. It is faster, reduces missed lines, and gives you a reusable template for similar configuration tasks later.

Related templates

Explore nearby sed workflows that target similar replace, cleanup, filtering, or rewrite tasks.

Uncomment lines Sed Template | AskSed