Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that linux wget download progress bar becomes multi-line display

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to solve the problem of linux wget download progress bar into multi-line display, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

In order to solve the problem that the Putty client connects to CentOS and displays garbled code, after setting up LANG=zh_CN.UTF-8, when downloading using wget, the wget download progress bar is abnormal and cannot be displayed on a single line, becoming a deceptive multi-line display, and each cycle wget automatically generates a new line, as a result, downloading files with slower progress will not take a while for the whole screen to be dominated by wget progress bars.

The code is as follows:

Wget's progress bar has become a miserable screen killer, with screens full of the following. (the = sign omits countless)

99% [= >] 10416337 6.09K/s eta (central England

99% [= >] 10419241 6.10K/s eta (central England

99% [= >] 10419241 5.73K/s eta (central England

99% [= >] 10425049 5.79K/s eta (central England

99% [= >] 10427953 5.65K/s eta (central England

10431288 5.65K/s in 27m 12s

This is completely different from the rhythm of the original line showing the progress bar. Later, it was found that this was because when translating, eta was converted to eta (UK Central time), resulting in the entire output being too long, causing a line break and causing the next output to start with a new line.

Later, it was found that there were many people with this problem on the Internet. The key point is that this problem has existed since a long time ago, and it can be modified quite quickly.

The code is as follows:

# Note that the file path is at: / usr/share/locale/zh_CN/LC_MESSAGES/

Cd / usr/share/locale/zh_CN/LC_MESSAGES/

# rename first

Mv wget.mo wget.mo.bak

# replace eta (UK Central time) with ETA from the renamed file, and export the new file

Msgunfmt wget.mo.bak-o-| sed 's/eta (UK Central time) / ETA/' | msgfmt-o wget.mo

TIPs:

1. If you do not have msgunfmt and msgfmt, install gettext (there is no direct way to install msgunfmt and msgfmt).

two。 I operate the above orders under the root user.

This is the answer to the question about how to solve the problem that the linux wget download progress bar becomes a multi-line display. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report