2025-03-14 21:59:59 -06:00
|
|
|
# tqdm
|
|
|
|
|
|
2025-04-25 19:33:51 -06:00
|
|
|
> Show progress over time of a command.
|
2025-03-14 21:59:59 -06:00
|
|
|
> More information: <https://tqdm.github.io/>.
|
|
|
|
|
|
2025-04-25 19:33:51 -06:00
|
|
|
- Show iterations per second and use `stdout` afterwards:
|
|
|
|
|
|
|
|
|
|
`{{seq 10000000}} | tqdm | {{command}}`
|
|
|
|
|
|
2025-03-14 21:59:59 -06:00
|
|
|
- Create a progress bar:
|
|
|
|
|
|
2025-04-25 19:33:51 -06:00
|
|
|
`{{seq 10000000}} | tqdm --total {{10000000}} | {{command}}`
|
|
|
|
|
|
|
|
|
|
- Create an archive out of a directory and use the file count of that directory to create a progress bar:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`zip {{[-r|--recurse-paths]}} {{path/to/archive.zip}} {{path/to/directory}} | tqdm --total $(find {{path/to/directory}} | wc {{[-l|--lines]}}) --unit files --null`
|
2025-04-25 19:33:51 -06:00
|
|
|
|
|
|
|
|
- Create an archive with tar and create a progress bar (system agnostic, GNU tar uses `stdout` while BSD tar uses `stderr`):
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`tar vzcf {{path/to/archive.tar.gz}} {{path/to/directory}} 2>&1 | tqdm --total $(find {{path/to/directory}} | wc {{[-l|--lines]}}) --unit files --null`
|