[HowTo] Install progress bar for cp/mv commands

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
User avatar
cpedretti
Level 2
Level 2
Posts: 88
Joined: Tue Mar 10, 2020 12:06 am

[HowTo] Install progress bar for cp/mv commands

Post by cpedretti »

Copy and move commands are parts of the coreutils package, but do not have a option for an progress bar.

The latest package available on LM20/LMDE4 are 8.30-3. (Source LM Source LMDE4)

We can found the source on github, but doesn't work because missing one thing to work...


First step to compile the binaries we will need additional dependencies:

Code: Select all

sudo apt install g++ pkg-config automake autoconf make -y

Then to move to the temp folder:

Code: Select all

cd /tmp

Once in the temp folder, we can download the coreutils archive and extract it:

Code: Select all

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

Code: Select all

tar xvJf coreutils-8.32.tar.xz

Code: Select all

cd coreutils-8.32/

We need to downlaod the patch for the progress bar into the coreutils folder and include it into the binaries:

Code: Select all

wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-0.8-8.32.patch

Code: Select all

patch -p1 -i advcpmv-0.8-8.32.patch

Now we can compile as simple user the coreutils binaries and install it:

Code: Select all

./configure

Code: Select all

make

Code: Select all

sudo make install
#was missing in most of example on the net...


To take effect we need to replace the old cp/mv commands with the news:

Code: Select all

sudo mv ./src/cp /usr/local/bin/advcp
sudo mv ./src/mv /usr/local/bin/advmv

Last part, add aliases in bash config file:

LMDE4

Code: Select all

echo alias cp='/usr/local/bin/advcp -g' >> ~/.bashrc
echo alias mv='/usr/local/bin/advmv -g' >> ~/.bashrc

LM19/20

Code: Select all

echo alias cp='cp -g' >> ~/.bashrc
echo alias mv='mv -g' >> ~/.bashrc

Now we have two more options available for the copy and move command like:

-g

Image


--progress-bar

Image



Source
AMD Ryzen 7 3700X - 32GB DDR4 - Sapphire RX570 8GB - SSD SAMSUNG EVO 860/HDD Toshiba - Mobo Gygabyte AORUS ELITE B450 - PSU Gigabyte 750W Gold - Case Zalman X3 White

LMDE4 Kernel 5.9
Post Reply

Return to “Tutorials”