Advanced Copy Command – Shows Progress Bar While Copying Large Files/Folders in Linux

Advanced-Copy is a powerful command line program which is very much similar, but little modified version of original cp command. This modified version of cp command adds a progress bar along with 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 user about the status of copy process and how long it takes to complete.

Download and Install Advanced-Copy

There are two methods to install Advanced-Copy utility in Linux systems, either you compile from sources or using pre-compiled binaries. Installing from pre-compiled binaries should always work correctly and requires lesser experience and very effective for Linux newbies.

But I suggest you to compile from sources, for this you required original version of GNU coreutils and latest patchfile of Advacned-Copy. The whole installation should go like this:

Compiling from Sources

First, download the latest version of GNU coreutils and patchfile using wget command and compile and patch it as shown below, you must be root user to perform all commands.

# 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

You might get the following error, while running “./configure” command.

checking whether mknod can create fifo without root privileges... configure: error: in `/home/tecmint/coreutils-8.21':
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 “./configure” command again.

export FORCE_UNSAFE_CONFIGURE=1

Once, compilation completes, two new commands are created under src/cp and src/mv. You need to replace your original cp and mv commands with these two new commands to get the progress bar while copying files.

# cp src/cp /usr/local/bin/cp
# cp src/mv /usr/local/bin/mv

Note: If you don’t want to copy these commands under standard system paths, you can still run them from source directory like “./cp” and “./mv or create new commands as shown”.

# mv ./src/cp /usr/local/bin/cpg
# mv ./src/mv /usr/local/bin/mvg

Automatic progress bar

If you want the progress bar to be appear all the time while copying, you need to add the following lines to your ~/.bashrc file. Save and close the file

alias cp='cp -gR'
alias mv='mv -g'

You need to logout and login again to get this work correctly.

How to Use Advacned-Copy Command

The command is same, the only change is adding “-g” or “–progress-bar” option with cp command. The “-R” option is for copying directories recursively. Here is an example screen-shots of a copy process using advanced copy command.

# cp -gR /Tecmint.com/ /data/

OR

# cp -R --progress-bar /Tecmint.com/ /data/

Advanced Copy Command

Advanced Copy Command

Here is the example of ‘mv‘ command with screen-shot.

# mv --progress-bar Songs/ /data/

OR

# mv -g Songs/ /data/

Advanced Mv Command

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 original cp and mv commands. You can call them via /usr/bin/cp or /usr/bin/mv.

I really much impressed with this new progress bar feature, at least I would know some information of copy operation time and exactly what’s going on.

Overall I can say, it is really good tool to have in your pocket, especially when you are spending lots of time in copying and moving files through command line.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

25 Responses

  1. Janis says:

    Hello Ravi,

    alias cp='cp -gR'
    alias mv='mv -g'
    

    is wrong. As command cp and mv does not have option -g.

    Right aliases:

    alias cp='cpg -gR'
    alias mv='mvg -g'
    
    • Ravi Saive says:

      @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..

  2. postal says:

    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

  3. Roxanne Benn says:

    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

    • Ravi Saive says:

      @Roxanne,

      You don’t have GCC header files, install them and run again same configure command again.

      # yum install glibc-devel
      
  4. Roxanne Benn says:

    error 404 when trying to connect to zwicke.org

  5. Dan says:

    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?

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.