From 93147ec3084347c65b40dc99cae32f5f76eb7f98 Mon Sep 17 00:00:00 2001 From: Ulysse Buonomo Date: Tue, 18 Feb 2025 16:54:50 +0100 Subject: [PATCH 1/8] tqdm: add examples --- pages/common/tqdm.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pages/common/tqdm.md b/pages/common/tqdm.md index e12a5ca47312a6..9889c5395ba3d2 100644 --- a/pages/common/tqdm.md +++ b/pages/common/tqdm.md @@ -1,8 +1,16 @@ # tqdm -> Create a progress bar. +> Show progress over time of a command. > More information: . +- Show iterations per second and use stdout afterwards: + +`{{seq 10000000}} | tqdm | {{command}}` + - Create a progress bar: -`seq 10000000 | tqdm --total 10000000 --null` +`{{seq 10000000}} | tqdm --total 10000000 | {{command}}` + +- Specify unit and total: + +`tar -zcf - {{docs/}} | tqdm --bytes --total $(du -sb {{docs/}} | cut -f1) > {{backup.tgz}}` From 909060af85e5692775bd6a44dec298e31bc6f2d5 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Wed, 26 Mar 2025 00:57:35 +0200 Subject: [PATCH 2/8] Update pages/common/tqdm.md Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> --- pages/common/tqdm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/tqdm.md b/pages/common/tqdm.md index 9889c5395ba3d2..e61cd4bf2fbae5 100644 --- a/pages/common/tqdm.md +++ b/pages/common/tqdm.md @@ -3,7 +3,7 @@ > Show progress over time of a command. > More information: . -- Show iterations per second and use stdout afterwards: +- Show iterations per second and use `stdout` afterwards: `{{seq 10000000}} | tqdm | {{command}}` From 5103dd710769b7346c9e043a7d00032dbd0bcf2b Mon Sep 17 00:00:00 2001 From: Ulysse Buonomo Date: Fri, 28 Mar 2025 02:40:30 +0100 Subject: [PATCH 3/8] Update pages/common/tqdm.md Co-authored-by: Managor <42655600+Managor@users.noreply.github.com> --- pages/common/tqdm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/tqdm.md b/pages/common/tqdm.md index e61cd4bf2fbae5..5fa4bc36604514 100644 --- a/pages/common/tqdm.md +++ b/pages/common/tqdm.md @@ -11,6 +11,6 @@ `{{seq 10000000}} | tqdm --total 10000000 | {{command}}` -- Specify unit and total: +- Create an archive out of a directory and use the file count of that directory to create a progress bar: `tar -zcf - {{docs/}} | tqdm --bytes --total $(du -sb {{docs/}} | cut -f1) > {{backup.tgz}}` From 744515fca07786028d8cdf53028c6d94df0b6ba0 Mon Sep 17 00:00:00 2001 From: Ulysse Buonomo Date: Fri, 28 Mar 2025 14:07:21 +0100 Subject: [PATCH 4/8] update archive command --- pages/common/tqdm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/tqdm.md b/pages/common/tqdm.md index 5fa4bc36604514..d8b1dd45a583f3 100644 --- a/pages/common/tqdm.md +++ b/pages/common/tqdm.md @@ -13,4 +13,4 @@ - Create an archive out of a directory and use the file count of that directory to create a progress bar: -`tar -zcf - {{docs/}} | tqdm --bytes --total $(du -sb {{docs/}} | cut -f1) > {{backup.tgz}}` +`zip -r {{backup.zip}} {{dir}} | tqdm --total $(find {{dir}} | wc -l) --unit files --null` From ebe775f215ffc7e0b63c07495bf00e8f34a0373e Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Sat, 5 Apr 2025 23:47:41 +0300 Subject: [PATCH 5/8] Update pages/common/tqdm.md --- pages/common/tqdm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/tqdm.md b/pages/common/tqdm.md index d8b1dd45a583f3..d85ab2ed8f40ab 100644 --- a/pages/common/tqdm.md +++ b/pages/common/tqdm.md @@ -13,4 +13,4 @@ - Create an archive out of a directory and use the file count of that directory to create a progress bar: -`zip -r {{backup.zip}} {{dir}} | tqdm --total $(find {{dir}} | wc -l) --unit files --null` +`zip -r {{path/to/archive.zip}} {{path/to/directory}} | tqdm --total $(find {{path/to/directory}} | wc -l) --unit files --null` From f2e2a10db45adfb0bf0015cb10f2e82d56c945a5 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Sat, 5 Apr 2025 23:47:52 +0300 Subject: [PATCH 6/8] Update pages/common/tqdm.md --- pages/common/tqdm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/tqdm.md b/pages/common/tqdm.md index d85ab2ed8f40ab..4f2ad0162321a1 100644 --- a/pages/common/tqdm.md +++ b/pages/common/tqdm.md @@ -9,7 +9,7 @@ - Create a progress bar: -`{{seq 10000000}} | tqdm --total 10000000 | {{command}}` +`{{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: From 392aaa5bede2162914db5b06e9a2196cbd800c9e Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Sat, 5 Apr 2025 23:52:29 +0300 Subject: [PATCH 7/8] Update tqdm.md --- pages/common/tqdm.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/common/tqdm.md b/pages/common/tqdm.md index 4f2ad0162321a1..bb768ad9e0b888 100644 --- a/pages/common/tqdm.md +++ b/pages/common/tqdm.md @@ -14,3 +14,7 @@ - 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}} |& tqdm --total $(find {{path/to/directory}} | wc -l) --unit files --null` From 60884b0e35e0a9db40e7473637a614477e13a66a Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:17:30 +0300 Subject: [PATCH 8/8] Update pages/common/tqdm.md Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> --- pages/common/tqdm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/tqdm.md b/pages/common/tqdm.md index bb768ad9e0b888..b440835cfc2a61 100644 --- a/pages/common/tqdm.md +++ b/pages/common/tqdm.md @@ -17,4 +17,4 @@ - 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}} |& tqdm --total $(find {{path/to/directory}} | wc -l) --unit files --null` +`tar vzcf {{path/to/archive.tar.gz}} {{path/to/directory}} 2>&1 | tqdm --total $(find {{path/to/directory}} | wc -l) --unit files --null`