1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/sponge.md

13 lines
317 B
Markdown
Raw Normal View History

2020-06-20 11:41:03 +08:00
# sponge
> Soak up the input before writing the output file.
> More information: <https://manned.org/sponge>.
2020-06-20 11:41:03 +08:00
- 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}}`