Fundamentals 3 min read

Add a Progress Bar to Linux cp and mv Commands

This guide shows how to patch coreutils so that the Linux cp and mv commands display a visual progress bar, covering version checks, source download, applying the advcpmv patch, compiling, configuring replacements, and testing the new functionality.

Linux Tech Enthusiast
Linux Tech Enthusiast
Linux Tech Enthusiast
Add a Progress Bar to Linux cp and mv Commands

In Linux, copying and moving files with cp and mv normally provides no visual feedback. By applying the advcpmv patch to the coreutils source, the commands can display a progress bar.

First, verify the installed coreutils version to ensure compatibility with the patch: rpm -qa | grep coreutils Download the coreutils 8.32 source package and the advcpmv patch:

wget http://ftp.gnu.org/gnu/coreutils/coreutils-8.32.tar.xz

Extract the source archive, then apply the patch whose description mentions fixing missing progress bars for moving files and global progress:

tar -xf coreutils-8.32.tar.xz
cd coreutils-8.32
patch -p1 < advcpmv-8.32.patch

Install the required build dependencies, then compile and install the patched coreutils:

./configure && make && sudo make install

Replace the system cp and mv with the newly built binaries, backing up the originals and adding convenient aliases in /etc/profile for everyday use:

mv /usr/bin/cp /usr/bin/cp.orig
ln -s /usr/local/bin/cp /usr/bin/cp
mv /usr/bin/mv /usr/bin/mv.orig
ln -s /usr/local/bin/mv /usr/bin/mv
# edit /etc/profile to add aliases if desired

Finally, run a copy or move operation to verify that a progress bar appears, showing the operation’s total duration and transfer speed after completion.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linuxpatchprogress barcpcoreutilsadvcpmvmv
Linux Tech Enthusiast
Written by

Linux Tech Enthusiast

Focused on sharing practical Linux technology content, covering Linux fundamentals, applications, tools, as well as databases, operating systems, network security, and other technical knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.