How to Show a Progress Bar in Curl
This article explains how to change the default, text-heavy progress
meter in curl to a clean, visual progress bar. You will
learn the specific command-line flags required to enable this visual
bar, how to apply it during file downloads, and how to configure it as
your default setting for all future operations.
By default, when you download a file using curl and
redirect the output to a file, it displays a detailed progress meter
containing statistics like download speed, total size, elapsed time, and
time remaining. While informative, this multi-column layout can be
cluttered.
The --progress-bar
Flag
To replace the default progress meter with a simple, clean progress
bar made of # symbols, use the -# (or
--progress-bar) option.
Here is the basic syntax:
curl -# -O https://example.com/file.zipOr using the long-form equivalent:
curl --progress-bar -O https://example.com/file.zipWhen you run this command, curl will display a
single-line progress bar that updates in real-time:
######################################################## 100.0%
Making the Progress Bar the Default
If you prefer the progress bar over the default meter for all your
downloads, you can make this change permanent by adding it to your
curl configuration file.
Open (or create) the
.curlrcfile in your home directory using a text editor:nano ~/.curlrcAdd the following line to the file:
progress-barSave and close the file.
Once saved, curl will automatically use the visual
progress bar for all future downloads without requiring you to type the
-# or --progress-bar flag every time.