How can I move files and view the progress (e.g. with a progress bar)?
When moving large directories using
mv, is there a way to view the progress (%)? The
cpcommand on gentoo had a
-gswitch that showed the progress.
Measure pipe throughput in the shell might help, although I don't know if it's possible to easily use those tools when moving a file
You can build a patched cp and mv which then both support the -g switch to show progress. There are instructions and patches at this page. However: The page instructs you to do
$ sudo cp src/cp /usr/bin/cp $ sudo cp src/mv /usr/bin/mv
which overwrites the original cp and mv. This has two disadvantages: Firstly, if an updated coreutils package arrives at your system, they are overwritten. Secondly, if the patched version has a problem, they might break scripts relying on standard cp and mv. I would rather do something like this:
$ sudo cp src/cp /usr/local/bin/cpg $ sudo cp src/mv /usr/local/bin/mvg
which copies the files to /usr/local/bin which is intended for user compiled programs and gives them a different name. So when you want a progress bar, you say
mvg -g bigfile /mnt/backupand use mv normally.
Also you can do
alias mvg="/usr/local/mvg -g"then you only need to say
mvg bigfile /mnt/backupand directly get the progress bar.
Unfortunately the patch on “this page” is no longer present and doesn't appear to have been indexed in the Web Archive. There appear to be many patches with a similar name and function, could you edit your answer to clarify which one you meant?