sponge

Soak up input before writing a file

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

From moreutils: lets you modify a file in a pipeline.

Examples
jq '.x=1' f.json | sponge f.jsonSafe in-place edit · explain & risk-check →
Related
tee
Open the full explainer →More in Text Processing

Reference text is hand-written and may be incomplete — check man sponge for your version. Test destructive commands on a non-production system first.