sponge
Soak up the input before writing the output file. More information: https://manned.org/sponge.
-
Append file content to the source file:
cat {{path/to/file}} | sponge -a {{path/to/file}}
-
Remove all lines starting with # in a file:
grep -v '^{{#}}' {{path/to/file}} | sponge {{path/to/file}}
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.