mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
18 lines
431 B
Plaintext
18 lines
431 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# 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|--invert-match]}} '^{{#}}' {{path/to/file}} | sponge {{path/to/file}}`
|