I want to inplement a progress bar use C like tqdm in Python or apt-get in Ubuntu. But I have no idea.
My problem is how to make the progress bar always be at the bottom of the terminal, and the top normally outputs something else.
Like the apt-get program in Ubuntu is implemented in the following figure.
2
Answers
If I understand you are simply trying to find only the progress bar within the apt or apt-get code, so you can make use of it later, then there is no guarantee that it is named Progress:, or that the prompt containing Progress: is even in the script you are searching. It is likely sourced from another file.
You can try opening the script in an editor like vim or kwrite or jot, etc. and looking within the script for where the meter is called and go from there. There is no telling whether it will be under scale, meter, percent, etc…
In the absence of finding anything, you can always use something simple. There are many available on the web. Example: