Browse by search intent
Use these keyword clusters to jump into delete-lines, replace-domain, and whitespace-cleanup workflows faster.
Delete lines
Templates for deleting matching lines, removing blank rows, and cleaning repeated noise from logs or text files.
Replace domain
Templates focused on replacing hostnames, ports, and path prefixes across config, docs, and migration files.
Cleanup whitespace
Open topic pageTemplates for removing empty lines, trimming trailing spaces, and rewriting line starts to keep files clean and consistent.
Replace
Replace ports in bulk
ReplaceReplace every 8080 in a config with 80.
sed 's/8080/80/g'View template
Replace domain names
ReplaceReplace an old domain with a new one in bulk.
sed 's/old\.example\.com/new.example.com/g'View template
Replace path prefixes
ReplaceReplace an old path prefix with a new one across many lines.
sed 's#/srv/legacy#/srv/current#g'View template
Replace URL paths
ReplaceReplace an old URL path segment with a new one across many lines.
sed 's#/v1/api#/v2/api#g'View template
Replace query parameters
ReplaceReplace one repeated query parameter value with another across many URLs.
sed 's/debug=true/debug=false/g'View template
Cleanup
Delete empty lines
CleanupRemove blank and whitespace-only lines.
sed '/^\s*$/d'View template
Remove trailing spaces
CleanupDelete trailing spaces and tabs at the end of each line.
sed 's/[[:space:]]\+$//'View template
Normalize whitespace
CleanupCollapse repeated spaces and tabs into one clean separator.
sed 's/[[:space:]]\+/ /g'View template
Remove duplicate blank lines
CleanupCollapse repeated blank lines so only one empty row remains.
sed '/^$/N;/^\n$/D'View template
Collapse multiple spaces
CleanupCollapse repeated spaces into a single space while keeping line structure.
sed 's/ */ /g'View template
Filter
Keep matching lines
FilterKeep only log lines that contain error.
sed -n '/error/p'View template
Delete matching lines
FilterRemove log lines that contain DEBUG.
sed '/DEBUG/d'View template
Delete comment lines
FilterDelete lines that start with comment markers such as #.
sed '/^#/d'View template
Keep error lines
FilterKeep only lines that contain error or ERROR.
sed -n '/[Ee][Rr][Rr][Oo][Rr]/p'View template
Delete DEBUG lines
FilterDelete log lines that contain DEBUG in bulk.
sed '/DEBUG/d'View template
Keep WARNING lines
FilterKeep only lines that contain warning or WARN.
sed -n '/WARN\|warning/p'View template
Delete TRACE lines
FilterDelete log lines that contain TRACE in bulk.
sed '/TRACE/d'View template