1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 05:42:09 +02:00

tqdm: add examples (#15751)

Co-authored-by: Managor <42655600+Managor@users.noreply.github.com>
Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Machiavelli <145562237+MachiavelliII@users.noreply.github.com>
This commit is contained in:
Ulysse Buonomo 2025-04-06 15:39:55 +02:00 committed by GitHub
parent b39f485fc3
commit 25ecce4c60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,20 @@
# tqdm # tqdm
> Create a progress bar. > Show progress over time of a command.
> More information: <https://tqdm.github.io/>. > More information: <https://tqdm.github.io/>.
- Show iterations per second and use `stdout` afterwards:
`{{seq 10000000}} | tqdm | {{command}}`
- Create a progress bar: - Create a progress bar:
`seq 10000000 | tqdm --total 10000000 --null` `{{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:
`zip -r {{path/to/archive.zip}} {{path/to/directory}} | tqdm --total $(find {{path/to/directory}} | wc -l) --unit files --null`
- Create an archive with tar and create a progress bar (system agnostic, GNU tar uses `stdout` while BSD tar uses `stderr`):
`tar vzcf {{path/to/archive.tar.gz}} {{path/to/directory}} 2>&1 | tqdm --total $(find {{path/to/directory}} | wc -l) --unit files --null`