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.
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.xzExtract 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.patchInstall the required build dependencies, then compile and install the patched coreutils:
./configure && make && sudo make installReplace 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 desiredFinally, run a copy or move operation to verify that a progress bar appears, showing the operation’s total duration and transfer speed after completion.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
