Solution to changing the linuxwget download progress bar to multi-line display

Source: Internet
Author: User
When wget is used for download, the wget download progress bar is abnormal and cannot be displayed in one row. it turns into a multi-line display of the pitfalls. a new row is automatically generated for wget in each cycle, as a result, the download progress is slow, and the entire screen is full of wget progress bars in a short time.

In order to solve the problem of garbled characters after the Putty client is connected to CentOS, after LANG = zh_CN.UTF-8 is set, wget download progress bar is abnormal when wget is used, it cannot be displayed on one line, it turns into a multi-line display of the potholes. wget will automatically generate a new line for each cycle, and the results will be downloaded slowly. the whole screen will be full of wget progress bars in a short time.


Copy codeThe code is as follows:
The progress bar of wget has become a miserable screen killer. the full screen is like the following... (no. = is omitted)

99% [============================================== ====>] 10,416,337 6.09 K/s eta (central UK time
99% [============================================== ====>] 10,419,241 6.10 K/s eta (central UK time
99% [============================================== ====>] 10,419,241 5.73 K/s eta (central UK time
99% [============================================== ====>] 10,425,049 5.79 K/s eta (central UK time
99% [============================================== ====>] 10,427,953 5.65 K/s eta (central UK time
100% [============================================== ====>] 10,431,288 5.65 K/s in 27 m 12 s

This is totally different from the progress bar of the original line. It was later discovered that this was because, during the translation, eta was converted to eta (central UK time), resulting in a long output and a broken line. as a result, the next output must start from a new line.

Later, I found that many people on the Internet had this problem. The key was that the problem had existed since a long time ago and it was still quite fast to modify.


Copy codeThe code is as follows:
# Note that the file path is/usr/share/locale/zh_CN/LC_MESSAGES/

Cd/usr/share/locale/zh_CN/LC_MESSAGES/
# Rename first
Mv wget.mo. bak
# Replace eta (central UK time) with ETA from the renamed File and export the new file
Msgunfmt wget.mo. bak-o-| sed's/eta (central UK time)/ETA/'| msgfmt--o wget.mo

TIPs:

1. if msgunfmt and msgfmt are not available, install gettext (you have not found the method for installing msgunfmt and msgfmt directly ).

2. the above commands are operated by the root user.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.