When moving large directories using
mv, is there a way to view the progress (%)?
cp command on gentoo had a
-g switch that showed the progress.
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
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:
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
Also you can do
I don't like the idea to overwrite binaries from coreutil when there are simpler solutions, so here are mine:
rsync: Rsync copies files and has a
The downside is, that rsync is a little bit slower than cp, but you should measure this with time and decide for your self, I can live with it :-)
Shell Script: A shell script can also create the progress bar. I found this a while ago on the net and I don't remember the source:
This will look like:
Its also written for the bourne shell, so it will run nearby everywhere.
You can use pipe viewer command
I often use this to copy a big file over a mounted network filesystem (combine with
A much better option is to use
The downside here is rsync only shows progress, not a progress bar.
First off: I never copy large files without using ionice, unless I know that I will not want to use the computer for half an hour or more.
Second: all my partitions are jouranled so intrapartition copying takes not time. If it is a long copy I do a "du -sm" on the files and "df -m|grep copy_to_partition". Then if curious how much more time it will take I do the "df" again and see how much of the files was copied.
If your goal is to move/copy a directory with progress bar, but avoiding non-terminal GUI, mc (Midnight Commander) is a good choice.