How to Show Progress Bar for Linux Commands

Very useful information for ppl uses lot of script works in Linux enviroment. Many Linux commands like dd, cp, rsync, and mv are progressive but have no progress bars showing as they run. There is no built-in way to check the progress of ongoing operations except few commands that recently had commits ( dd command

Very useful information for ppl uses lot of script works in Linux enviroment. Many Linux commands like dd, cp, rsync, and mv are progressive but have no progress bars showing as they run. There is no built-in way to check the progress of ongoing operations except few commands that recently had commits ( dd command

Very useful information for ppl uses lot of script works in Linux enviroment.

Many Linux commands like dd, cp, rsync, and mv are progressive but have no progress bars showing as they run. There is no built-in way to check the progress of ongoing operations except few commands that recently had commits ( dd command has status=progress from GNU coreutils version 8.24). In this article, we’ll look at certain Linux tools and options which allow you to monitor the progress of data being transferred.

Debian, Ubuntu and Linux Mint

# apt-get install pv

Monitor the progress of creating an archive using gzip

In this example, we use pv with gzip in the following example:

$ pv -tpre ~/Desktop/testfile.iso | gzip > ~/Desktop/testfile.gz
213MiB 0:00:14 [17.8MiB/s] [=========> ] 32% ETA 0:00:29

Monitor the progress when copying a file with pv

bash $ pv ~/Desktop/testfolder/* > ~/Desktop/
667MiB 0:00:13 [50.5MiB/s] [================================>] 100%

Using pv without any switches will automatically run with the default p, t, e,r and b switches.

Using pv and dialog commands to create a dialog progress bar

$ pv ~/Desktop/testfile.iso > ~/Desktop/destinationfile.iso | dialog --gauge "Progress" 10 70

Installing Progress

You can install progress on any distro with these steps. (for Debian/Ubuntu) users:

$ sudo apt-get install libncurses5-dev

or clone git repo:

# git clone https://github.com/Xfennec/progress.git 
# make 
# make install

Progress Usage with Examples

The general syntax for progress is watch progress -q. This lets you monitor all current and upcoming transfers in a terminal window. Now, any coreutils utility you invoke like cp and mv will be detected and indicated in the progress window.

Monitoring Downloads

progress -wc google-chrome

The -c switch can be used to monitor a command name like google-chrome or Firefox

Installing Rsync

Fedora, CentOS and RHEL

# yum install rsync

Debian, Ubuntu and Linux Mint

# apt-get install rsync

Rsync Usage with Examples

You need to use rsync with the -P or --progress option to show progress during file transfer. The basic syntax for rsync is

rsync --progress source destination

Source: How to Show Progress Bar for Linux Commands

Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments