Advanced-Copy is a powerful command line program that is very much similar, but a little modified version of the original cp command and mv tools.
This modified version of the cp command adds a progress bar along with the total time taken to complete while copying large files from one location to another.
This additional feature is very useful especially while copying large files, and this gives an idea to the user about the status of copy process and how long it takes to complete.
Install Advanced-Copy Command in Linux
The only way to install the Advanced-Copy utility in Linux systems is by building from sources using the following single curl command, which will download, patch, compile coreutils and generate the files: ./advcpmv/advcp
and ./advcpmv/advmv
.
# curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh && (cd advcpmv && sh install.sh)
You might get the following error, during the installation process.
checking whether mknod can create fifo without root privileges... configure: error: in `/root/advcpmv/coreutils-9.1': configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check) See `config.log' for more details
Run the following command on the terminal to fix that error and run the curl command again.
# export FORCE_UNSAFE_CONFIGURE=1 # curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh && (cd advcpmv && sh install.sh)
Once, the installation completes, two new commands are created under ./advcpmv/advcp and ./advcpmv/advmv. You need to replace your original cp and mv commands with these two new commands to get the progress bar while copying files.
# mv ./advcpmv/advcp /usr/local/bin/cp # mv ./advcpmv/advmv /usr/local/bin/mv
Note: If you don’t want to copy these commands under standard system paths, you can still run them from the source directory like “./advcpmv/advcp” and “./advcpmv/advmv or create new commands as shown”.
# mv ./advcpmv/advcp /usr/local/bin/cpg # mv ./advcpmv/advmv /usr/local/bin/mvg
Show Progress Bar While Copying Files and Directories
If you want the progress bar to appear all the time while copying files and directories, you need to add the following lines to your ~/.bashrc file.
# echo alias cp '/usr/local/bin/advcp -g' >> ~/.bashrc # echo alias mv '/usr/local/bin/advmv -g' >> ~/.bashrc
You need to log out and log in again to get this to work correctly.
How to Use Advanced-Copy Command in Linux
The command is the same, the only change is adding the “-g” or “–progress-bar” option with the cp command. The “-R” option is for copying directories recursively.
Copy Files with Progress Bar
Here are example screen-shots of a copy process using the advanced copy command.
# cp -gR ubuntu-20.04.3-desktop-amd64.iso /home/tecmint/ OR # cp -R --progress-bar ubuntu-20.04.3-desktop-amd64.iso /home/tecmint/
Move Files with Progress Bar
Here is an example of the ‘mv‘ command with a screenshot.
# mv --progress-bar Songs/ /data/ OR # mv -g Songs/ /data/
Please remember, original commands are not overwritten if you ever need to use them or you’re not happy with the new progress bar and want to revert back to the original cp and mv commands. You can call them via /usr/bin/cp or /usr/bin/mv.
I really impressed with this new progress bar feature, at least I would know some information about copy operation time and exactly what’s going on.
Overall I can say, it is a really good tool to have in your pocket, especially when you are spending lots of time copying and moving files through the command line.
“There are two methods to install Advanced-Copy utility in Linux systems, either you compile from sources or using pre-compiled binaries.”
And for the second method??????????? Nothing?! Zero! Zilch! Nada!
Hello Ravi,
is wrong. As command cp and mv does not have option
-g
.Right aliases:
@Janis,
But the
-g
options worked for me on CentOS 6 version. On which Linux distribution version you’ve tried? let me give a try and see..While running “make” i got this error, not sure what to do.
CC lib/freadseek.o
lib/freadseek.c: In function ‘freadptrinc’:
lib/freadseek.c:67:3: error: #error “Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib.”
#error “Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib.”
^~~~~
make[2]: *** [Makefile:6662: lib/freadseek.o] Error 1
Thanks for updating but now it will not let me configure it I ran the command #export FORCE_UNSAFE_CONFIGURE=1 but still no luck can you help me here is what came up on terminal.
roxanne-Satellite-C55-B coreutils-8.21 # ./configure
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking for style of include used by make… GNU
checking for gcc… gcc
checking whether the C compiler works… no
configure: error: in `/home/roxanne/coreutils-8.21′:
configure: error: C compiler cannot create executables
See `config.log’ for more details
roxanne-Satellite-C55-B coreutils-8.21 # make
There seems to be no Makefile in this directory.
You must run ./configure before running ‘make’.
GNUmakefile:106: recipe for target ‘abort-due-to-no-makefile’ failed
make: *** [abort-due-to-no-makefile] Error 1
@Roxanne,
You don’t have GCC header files, install them and run again same configure command again.
error 404 when trying to connect to zwicke.org
@Roxanne,
Thanks for updating, added new installation instructions with new link..
Outside of a complicated compile process for a basic command, you told us nothing about the cp command itself as the page said it was going to and doesn’t discuss any options. Are there overwrite options? Does a directory have to exist before copying a file to it or can cp create the directory as on option?
Why not just use rsync with the –progress flag?
@Brandon,
Yes, you absolutely correct we can use rsync with –progress option while copying/transferring files, but some people do different way..:)
Thank you
when i download with wget http://zwicke.org/web/advcopy/advcpmv-0.5-8.21-static.tar.xz . Following message appear . help me
Resolving zwicke.org (zwicke.org)… 46.163.116.104
Connecting to zwicke.org (zwicke.org)|46.163.116.104|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2015-05-23 06:58:47 ERROR 404: Not Found.
Me too got the same error…..
[root@localhost coreutils-8.21]# wget http://zwicke.org/web/advcopy/advcpmv-0.5-8.21.patch
–2015-08-26 13:43:44– http://zwicke.org/web/advcopy/advcpmv-0.5-8.21.patch
Resolving zwicke.org… 46.163.116.104
Connecting to zwicke.org|46.163.116.104|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2015-08-26 13:43:44 ERROR 404: Not Found.
@feedblade
Were you able to resolve the Issue?
https://raw.githubusercontent.com/atdt/advcpmv/master/advcpmv-0.5-8.21.patch
[root@DEEPAKPC coreutils-8.21]# cp src/cp /usr/bin/
cp: overwrite ‘/usr/bin/cp’? y
cp: cannot create regular file ‘/usr/bin/cp’: Text file busy
I think something is preventing your from overwriting the file, so better use -f flag, it will force you to copy file. like
Something -is- preventing the cp, the actual cp command itself :)
Use an intermediate step and cp the new cp file as /usr/bin/cp1, then mv the old one out of the way and mv the new into place. It won’t be locked then. (I’m sure there’s some other smarter way of doing this, but this works).
Also, the links to the patches are dead.
Is there any malware patch in this ?
No man, it’s safe to use..
thanks!!!!
This thing always result in segmentation fault after 3~4 GB of data copied, using pre-compiled binaries, on Ubuntu 13.04.
you could always create simple aliases for rsync:
alias rcopy=”rsync –partial –progress –append –rsh=ssh -r -h”
alias rmove=”rsync –partial –progress –append –rsh=ssh -r -h –remove-sent-files”
works great:)
You could also just use scp with localhost.
I don’t log out every time i add a new alias, I just type:
source ~/.bashrc
and it’s ready for use :)
I always use for this “rsync –progress” really simple