How to copy or move from shell with progressbar

When I am copying or moving a big file or a large number of small files, I wish I could see some progress of the operation and the speed at which the operation is being performed. This can be done by using the Advanced Copy mod of the cp and mv commands, which have been patched to display a progressbar with all this information during the operation. You can either get the source code or pre-built binaries from here.

I like to use these commands by default, so I move them to /usr/local/bin:

$ sudo cp ./cp /usr/local/bin
$ sudo cp ./mv /usr/local/bin

Typically, your PATH puts /usr/local/bin ahead of /bin, so the patched versions of the commands will be executed now. Else, change your PATH to accomplish this.

To view the progressbar for a operation, use the -g option:

$ cp -g -R foo-big-file.bin /media/joe/backup/

I use the fish shell, where I have added aliases for both of these commands with progressbar display:

function cpg
    cp -g $argv

function mvg
    mv -g $argv

Tried with: Ubuntu 14.04


3 thoughts on “How to copy or move from shell with progressbar

  1. Hey! Thanks for the tip. It didn’t worked for me though, cp command really doesn’t like the -g option jaja. It’s not allowed it says.
    I did a workaround with fish and rsync to make the alias of cp, but still I would like to know why this isn’t working for me 😦
    Using Ubuntu Gnome 1404 x64.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s