add description and example of sponge
parent
92ef5bd205
commit
6c89dab616
12
README.md
12
README.md
|
@ -247,6 +247,18 @@ A few examples of piecing together commands:
|
||||||
awk '{ x += $3 } END { print x }' myfile
|
awk '{ x += $3 } END { print x }' myfile
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- `sponge`: from moreutils - soak up standard input and write to a file. I you want to change a file that is the source of a pipline: Instead of:
|
||||||
|
```bash
|
||||||
|
cat file | sort | uniq | iconv -f utf8 -t latin1 > /tmp/file && mv /tmp/file file
|
||||||
|
```
|
||||||
|
|
||||||
|
You can do:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cat file | sort | uniq | iconv -f utf8 -t latin1 | sponge file
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
- If want to see sizes/dates on a tree of files, this is like a recursive `ls -l` but is easier to read than `ls -lR`:
|
- If want to see sizes/dates on a tree of files, this is like a recursive `ls -l` but is easier to read than `ls -lR`:
|
||||||
```sh
|
```sh
|
||||||
find . -type f -ls
|
find . -type f -ls
|
||||||
|
|
Loading…
Reference in New Issue