mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-07 17:46:02 +02:00
sponge: add page (#4117)
This commit is contained in:
parent
fb0fed50fd
commit
6e943a3808
1 changed files with 12 additions and 0 deletions
12
pages/common/sponge.md
Normal file
12
pages/common/sponge.md
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# sponge
|
||||||
|
|
||||||
|
> Soak up the input before writing the output file.
|
||||||
|
> More information: <https://linux.die.net/man/1/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}}`
|
Loading…
Add table
Reference in a new issue