mirror of
https://github.com/xmengnet/the-art-of-command-line.git
synced 2024-12-25 01:56:30 +08:00
Merge pull request #490 from mkwardakov/file-copy-progress
Fix #95: add info on progress while copying
This commit is contained in:
commit
c118b6c741
1 changed files with 2 additions and 2 deletions
|
@ -260,6 +260,8 @@ Notes:
|
||||||
mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir
|
mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- For seeing progress when copying files, use `pv`, [`pycp`](https://github.com/dmerejkowsky/pycp), [`progress`](https://github.com/Xfennec/progress), `rsync --progress`, or, for block-level copying, `dd status=progress`.
|
||||||
|
|
||||||
- Use `shuf` to shuffle or select random lines from a file.
|
- Use `shuf` to shuffle or select random lines from a file.
|
||||||
|
|
||||||
- Know `sort`'s options. For numbers, use `-n`, or `-h` for handling human-readable numbers (e.g. from `du -h`). Know how keys work (`-t` and `-k`). In particular, watch out that you need to write `-k1,1` to sort by only the first field; `-k1` means sort according to the whole line. Stable sort (`sort -s`) can be useful. For example, to sort first by field 2, then secondarily by field 1, you can use `sort -k1,1 | sort -s -k2,2`.
|
- Know `sort`'s options. For numbers, use `-n`, or `-h` for handling human-readable numbers (e.g. from `du -h`). Know how keys work (`-t` and `-k`). In particular, watch out that you need to write `-k1,1` to sort by only the first field; `-k1` means sort according to the whole line. Stable sort (`sort -s`) can be useful. For example, to sort first by field 2, then secondarily by field 1, you can use `sort -k1,1 | sort -s -k2,2`.
|
||||||
|
@ -454,8 +456,6 @@ A few examples of piecing together commands:
|
||||||
|
|
||||||
- `comm`: compare sorted files line by line
|
- `comm`: compare sorted files line by line
|
||||||
|
|
||||||
- `pv`: monitor the progress of data through a pipe
|
|
||||||
|
|
||||||
- `strings`: extract text from binary files
|
- `strings`: extract text from binary files
|
||||||
|
|
||||||
- `tr`: character translation or manipulation
|
- `tr`: character translation or manipulation
|
||||||
|
|
Loading…
Reference in a new issue