When copying files using cp, is it possible to display the progress and speed of the transfer? Otherwise, is there any alternative command line utility that can achieve this?
|
|
||||
|
|
|
While
Note: this method will lose the file's permissions and ownership. Files copied this way will have the same permissions as if you'd created them yourself and will belong to you. In this example, This is what it looks like:
You may need to *: The technical bit There are three important streams of data in a unix-like system: stdout (standard output), stderr (standard error) and stdin (standard input). Every program has all three, so to speak. The pipe-operator redirects a programs output to another programs input. The
(where Take a look at Another option, as
This will preserve the files permissions/ownership while showing progress. |
|||||||||||||||||||||
|
|
You can copy use any program. At the same time, you can start |
|||
|
|
|
The kernel knows most of the data such as speed, and often also percentage. Modern kernels expose this via their /proc filesystem. showspeed from https://github.com/jnweiger/showspeed uses that info. It can attach to already running programs and give periodic updates like this:
|
|||||||||
|
|
There isn't. See here as to why. Although it does more than you need, rsync has one with
The output will look something like this:
|
|||||||||||||||||
|
|
There is a tool called Install it using the command
This tool can be used like that:
Output:
|
||||
|
|
|
Option added in GNU Coreutils 8.24+ (Ubuntu 16.04):
Stdout is a periodically updated line like:
See also: How do you monitor the progress of dd? |
||||
|
|
|
If you have rsync 3.1 or higher (
Note that sudo is only needed if dealing with directories/files you don't own. Also, without the I've found that the percentage and time remaining are grossly overestimated when copying to a directory that already contains files (ie. like when you would typically use cp -n "no clobber"). |
||||
|
|
|
Depending on what you want to do, Midnight Commander ( Tools like |
|||||
|
|
Use a shell script:
This will look like:
|
||||
|
|
|
While
Please ensure the This can show the progress, but if you want the percentage information,
Replace Here Comes the Remote PartWhile
|
|||||
|
|
While it doesn't display speed, when copying multiple files, the
|
|||||
|
|
There's a new tool called cv that can find any descriptor related to a running command and show progress and speed: https://github.com/Xfennec/cv
outputs the stats for all running cp,mv etc. operations |
|||||||||||||
|
|
I get a kick out of using cURL for this exact purpose. The man page lists the "FILE" protocol as supported, so just use it like any other protocol in a URL:
Speed, progress, time remaining, and more -- all in a familiar format. |
|||||||||||||
|
|
As many said, cp does not include this functionality. Just to throw my $0.02, what I usually do with trivial copying situations (i.e. no
This can keep me updated on target file size, with quite a minimum hassle. As an alternative for less trivial situations, e.g. recursively copying directories, you can use Update: In case you use wild-cards with command used with watch du, e.g.
otherwise the wild-cards will be expanded only once, when watch is started so du will not look at new files / subdirectories. |
|||||
|
|
If you want to see if your files are transferring correctly you could use
However, even when the progress bar has reached 100% when using the tool, you must wait until your terminal prompt reappears before safely removing your media so that you can ensure that the transfer process has successfully finished.
Install
(Note: in Ubuntu 12.10 the new automount point is, for example, You can copy a file to your media by entering
and copy a folder to your media with
Sample output from
You can of course specify multiple files or folders to copy to your disk, and there are a lot of other options covered in |
|||||||||||||
|
DoR