Linux command
tqdm 命令
文件
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Add progress bar to pipeline
cat [file] | tqdm --bytes | wc -l
With estimated total
cat [file] | tqdm --total [1000] | process
Custom unit
cat [files] | tqdm --unit files | process
Write to file
cat [input] | tqdm > [output]
With description
seq [100] | tqdm --desc "[Processing]" | process
说明
tqdm (from Arabic "taqaddum" meaning progress) adds progress bars to command-line pipelines by wrapping standard input/output streams. It displays real-time statistics including iteration speed, elapsed time, and estimated time remaining. The tool works as both a CLI pipe wrapper and a Python library. In CLI mode, it counts lines or bytes passing through and renders a visual progress bar on stderr. When --total is specified, it shows a percentage-based progress bar; otherwise it displays a simple counter with speed estimation.
参数
- --total _N_
- Expected iterations.
- --unit _NAME_
- Unit name.
- --desc _TEXT_
- Description prefix.
- --bytes
- Byte counting mode.
- --null
- Use null character as line separator.
- --ncols _N_
- Width of the progress bar output.
- --ascii
- Use ASCII characters for the progress bar instead of unicode.
- --colour _COLOUR_
- Progress bar colour (e.g., red, green, #00ff00).
- --mininterval _SECONDS_
- Minimum display update interval (default: 0.1).
FAQ
What is the tqdm command used for?
tqdm (from Arabic "taqaddum" meaning progress) adds progress bars to command-line pipelines by wrapping standard input/output streams. It displays real-time statistics including iteration speed, elapsed time, and estimated time remaining. The tool works as both a CLI pipe wrapper and a Python library. In CLI mode, it counts lines or bytes passing through and renders a visual progress bar on stderr. When --total is specified, it shows a percentage-based progress bar; otherwise it displays a simple counter with speed estimation.
How do I run a basic tqdm example?
Run `cat [file] | tqdm --bytes | wc -l` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --total _N_ do in tqdm?
Expected iterations.