Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Be aware, however, that this adds quite some overhead (30% to 50% in my tests) to the time needed to copy a file. A probably better way would be to use <code>dd</code> under the hood and get its progress status by <code>kill -USR1 $PID</code>. You lose all switches that <code>cp</code> understands, however.
In the end it would probably be better to add a switch to <code>p</code>.
Last edited by frenchn00b; 11-07-2009 at 01:10 AM.
This does exactly what the creator of this thread had in mind. All you have to do is add -g to cp and you have one overall and one per file progress bar to entertain you while you're waiting
This does exactly what the creator of this thread had in mind. All you have to do is add -g to cp and you have one overall and one per file progress bar to entertain you while you're waiting
that's nice but you have to consider this, that advanced cp has to have too :
cp -R
cp -a
cp -u
...
and so on ... those are highly important for various uses.
Our cp function, the standard, is already very advanced and serves all sorts of uses
This does exactly what the creator of this thread had in mind. All you have to do is add -g to cp and you have one overall and one per file progress bar to entertain you while you're waiting
Wow. I've been looking for this kind of functionality for some time. I know rsync is a more robust alternative for heavy duty copies, but I consider rsync to be more for scripted operations. A '--progress-bar' option should be a stock option for cp. I compiled your source and copied the executable as 'acp'.
The only thing left is to develop effective resume options.
Wow. I've been looking for this kind of functionality for some time. I know rsync is a more robust alternative for heavy duty copies, but I consider rsync to be more for scripted operations. A '--progress-bar' option should be a stock option for cp. I compiled your source and copied the executable as 'acp'.
The only thing left is to develop effective resume options.
Thanks for the patch
rsync is bit buggy. Sometimes it hangs saying that configuration files are missing. beware. cp is more robust, by far.
I've never had problems with rsync, although it is all the more reason to push this patch. I've copied many gigs with advanced copy, and am yet to have serious problems. However, it seems the reported speed and time estimations can be a bit erratic.
I know this thread is getting kinda old, but there doesn't seem to be another _real_ solution, yet, so here's mine:
(removed: not allowed to quote an url)
It's a patch for the original GNU coreutils.
This does exactly what the creator of this thread had in mind. All you have to do is add -g to cp and you have one overall and one per file progress bar to entertain you while you're waiting
Have you submitted this as a patch to GNU coreutils?
I know this thread is quite old, but could not find the solution in a easy way, but combined solutions find elsewhere. Basically one could use the pv. Pv needs to be installed on you system though. (Package name is sys-apps/pv for gentoo). The following one-liner could be used:
cp does not accept to write to standard output by default. It will fail if no input or output is given. So, in order to make it pipe to pv, we use /proc/self/fd/N. fd 0 represent standard input, fd 1 standard output and fd 2 standard error (we don't need that one for this purpose).
To get a process bar, we have to tell pv how much data it will read before we reach 100%. You can find the size of your file with:
Code:
du -h <source>
The size argument accepts K, M and G. Just like du -h gives you.
This will only work with a single file, so not for recursive copy of directories. You could use the rsync alternative for that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.