Add a progress bar to copy command in linux

August 20, 2012 — 3 Comments

I was looking for a way to have a progress bar when using the cp command as I move a lot of files over my LAN from my server to my Drobo, and wanted to know the transfer speeds. Since cp doesn’t have an option to show a progress bar I came across this handy modification you can make to your bash profile.

Works quite well and you now have a nice progress bar when copying files via the command line.

  • Justin

    This works well enough but I would say that overloading systems commands is *always* a bad idea. The next tool that call’s cp without specifying the full binary path is going to use rsync instead… possibly ending in disaster. I would set the alias to ‘progcp’ or something. Much safer.

    Another great tool for this is pipe viewer. Something like pv somefile > /path/to/destination/somefile works nicely. pv is also handy for any other pipe’able operation that you want to see the progress of. For example; dd if=/dev/disk/blah | pv | dd of=/path/to/dest/blah.img

    http://www.ivarch.com/programs/pv.shtml

  • http://stacklinux.com/ StackLinux

    Works thanks

    • http://www.fauxzen.com/ Shelby DeNike

      No problem, glad it worked for you.