ArchLinux - Monitor copy progression with Advanced Copy patch

advcpmv

Advanced Copy is a mod for the GNU cp and GNU mv tools which adds a progress bar and provides some info on what's going on.

It was written by Florian Zwicke and released under the GPL.

Original website (http://beatex.org/web/advancedcopy.html) is dead but a backup git repository exist (https://github.com/atdt/advcpmv).

Compile from sources

You will need gcc, make and patch.

1
2
3
4
5
6
7
$ wget http://ftp.gnu.org/gnu/coreutils/coreutils-8.21.tar.xz
$ tar xvJf coreutils-8.21.tar.xz
$ cd coreutils-8.21/
$ wget https://raw.githubusercontent.com/atdt/advcpmv/master/advcpmv-0.5-8.21.patch
$ patch -p1 -i advcpmv-0.5-8.21.patch
$ ./configure
$ make

The new programs are now located in src/cp and src/mv. Place them somewhere else:

1
2
$ sudo cp src/cp /usr/local/bin/cp
$ sudo cp src/mv /usr/local/bin/mv

You can make some aliases, for example:

1
2
alias cpa='/usr/local/bin/cp -g'
alias mva='/usr/local/bin/mv -g'

You may want this aliases to be permanent so place them in your ~/.zshrc (or ~/.bashrc) or create a profile script containing the two previous aliases:

1
# vim /etc/profile.d/alias-advcpmv.sh

And then create another profile script for sudo otherwise you won't be able to call the previous aliases with sudo. To be able to pass aliases to sudo create the following file:

1
# vim /etc/profile.d/alias-sudo.sh

Containing:

1
2
alias sudo='sudo '
# whitespace ---^

Running

Now when using cpa, sudo cpa -rn, etc... you will use /usr/local/bin/cp -g, sudo /usr/local/bin/cp -grn, etc...

Share