How to show the transfer progress and speed when copying files with cp?
Otherwise, is there any alternative command line utility that can achieve this?
command-line coreutils
add a comment |
Otherwise, is there any alternative command line utility that can achieve this?
command-line coreutils
add a comment |
Otherwise, is there any alternative command line utility that can achieve this?
command-line coreutils
Otherwise, is there any alternative command line utility that can achieve this?
command-line coreutils
command-line coreutils
edited Mar 15 '18 at 21:45
Ciro Santilli 新疆改造中心 六四事件 法轮功
9,65944448
9,65944448
asked Dec 14 '10 at 4:48
Olivier LalondeOlivier Lalonde
20.9k50112140
20.9k50112140
add a comment |
add a comment |
18 Answers
18
active
oldest
votes
While cp
hasn't got this functionality, you can use pv
to do this:
pv my_big_file > backup/my_big_file
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, pv
basically just outputs the file to stdout*, which you redirect to a file using the >
operator. Simultaneously, it prints information about the progress to the terminal when you do that.
This is what it looks like:
stefano@ubuntu:~/Data$ pv my_big_file > backup/my_big_file
138MB 0:00:01 [73.3MB/s] [=================================>] 100%
You may need to Install pv (alternatively, type sudo apt-get install pv
) on your system.
*: 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 >
redirection operator redirects program output to a file. Without arguments, as you see above, >
redirects a program's standard output to a file. cp
basically does nothing fancier than
cat source > destination
(where cat
just reads a file and prints it to stdout). pv
is just like cat, but if you redirect it's output stream somewhere else, it will print progress information to stdout instead.
Take a look at man pv
to learn more about it.
Another option, as DoR suggests in this answer, is to use rsync instead:
$ rsync -ah --progress source-file destination-file
sending incremental file list
source-file
621.22M 57% 283.86MB/s 0:00:01
This will preserve the files permissions/ownership while showing progress.
3
It may or may no be significant (depending on the situation), butpv
does not handle permissions the same way ascp
does... (based on one quick test I tried:pv
didn't copy the execute bit across..rsync
did.
– Peter.O
Dec 14 '10 at 15:55
41
IMO:alias cp="rsync -avz"
cp is outdated.
– Marco Ceppi♦
Dec 26 '10 at 1:26
10
If you're like me, and forget aboutpv
, you can go snooping in/proc/PID of cp/fd
and/proc/PID of cp/fdinfo
to figure out progress. (It's up to you to infer speed.) I use this technique to watchupdatedb
.
– Thanatos
Dec 26 '10 at 1:30
6
Yes,-z
should probably only be used for network copies; compressing and decompressing the data for a local copy is pure overhead.
– Matthew Read
Jun 17 '15 at 15:17
2
@MarcoCeppi , when copying directory withrsync
be sure not to add trailing/
to source path (or remove if e.g. bash completion put it there automatically). Otherwise you will get results different than when usingcp
(orgcp
).
– Piotr Findeisen
Apr 3 '16 at 19:07
|
show 10 more comments
There isn't. See here as to why. Although it does more than you need, rsync has one with --progress
parameter. The -a will keep permissions,etc, and -h will be human readable.
rsync -ah --progress source destination
The output will look something like this:
Pictures/1.jpg
2.13M 100% 2.28MB/s 0:00:00 (xfr#5898, to-chk=1/5905)
Pictures/2.jpg
1.68M 100% 1.76MB/s 0:00:00 (xfr#5899, to-chk=0/5905)
4
This works great in the current Ubuntu (14.10). It also supports the-r
flag to recurse directories. It can even be aliased as a direct replacement for cp:alias cp="rsync -ah --progress"
– rustyx
Dec 23 '14 at 21:04
1
Works swell on OS X, with the bonus of being able to use tools included with the system.
– Ivan X
Apr 24 '15 at 20:11
this is great, the output looks likefilename MB-copied MB-speed time-remaining)
– Rudolf Olah
May 21 '17 at 15:20
2
i like this alternative better than pv, specially because rsync is part of the standard install
– Joao Costa
Sep 17 '17 at 18:31
@bartekbrak thanks for sharing. I'm presently on macOS 10.12.x running homebrew version of rsync 3.1.2 and using--progress
makes my head spin 🙃 watching all the output display in the terminal. So those coming here from AOL keyword searches,rsync -ah --info=progress2 [source] [destination]
presents the output in a little more sane 👩⚕️ manner IMHO.
– ipatch
Mar 1 '18 at 19:53
|
show 2 more comments
If you want to see if your files are transferring correctly you could use gcp
and gcp
is like cp but by default gives you a progress bar so that you can see what is being copied. As the program's wiki notes, gcp
has several useful features such as
- transfer progression indication
- continuous copying on error (skip to next file)
- copy status logging: gcp logs all its actions so that it is possible to know which files have been successfully copied
- name mangling to handle target filesystem limitations (for example deletion of incompatible characters "*" or "?" on FAT)
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.
gcp
is used to copy files and has options such as --preserve
so that various attributes and permissions can be preserved and --recursive
so that whole directories can be copied. More information on its options can be found by entering man gcp
or by going to the Ubuntu manpages online. A tutorial is also available on this site.
Install gcp
from the repositories with
sudo apt-get install gcp
(Note: in Ubuntu 12.10 the new automount point is, for example, /media/user/usbdisk
)
You can copy a file to your media by entering
gcp /home/mike/file.mp4 /media/usb
and copy a folder to your media with
gcp -rv ~/Podcasts /media/Mik2
Sample output from gcp
with the progress bar:
gcp ~/Videos_incIplayer/mars.flv /media/Mik2
Copying 168.57 MiB 100% |########################################################| 7.98 M/s Time: 00:00:22
You can of course specify multiple files or folders to copy to your disk, and there are a lot of other options covered in man gcp
.
4
Got error with it over sshdbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
– msa7
Jan 17 '16 at 23:29
3
if you have a X11 display open on the machine you can just setexport DISPLAY=:0.0
before starting gcp. If the machine is headless then you'd have to start a xsession into a virtual framebuffer or something, at that point you should probably just look for another program
– user292067
Oct 9 '16 at 17:33
1
gcp
is pretty decent but the DBUS/X requirement is odd. I handled this over SSH by using ssh forwarding:ssh -X user@host
and that allowed me to run it.
– Oli♦
Oct 21 '16 at 12:24
add a comment |
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:
curl -o destination FILE://source
Speed, progress, time remaining, and more -- all in a familiar format.
1
This is great especially in environments where you are prohibited from installing new tools and where rsync is unavailable.
– user190264
Sep 5 '13 at 7:00
5
Brilliant, this has got to be a must-known hack!
– ionreflex
Oct 20 '15 at 18:13
Nice answer! Clever!
– 9301293
Jan 10 '18 at 20:48
This presumably has the same drawback aspv
, that it won't save permissions.
– Ploni
Jul 9 '18 at 0:09
add a comment |
While it doesn't display speed, when copying multiple files, the -v
option to the cp
command will provide you with progress info. e.g.
cp -rv old-directory new-directory
6
Progress info? This is just verbose output. To provide progress info you would at least need to now how many files, or even which files, needs to be copied.
– Julian F. Weinert
Jul 3 '15 at 20:21
add a comment |
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:
$ dd if=bigfile of=/tmp/otherbigfile &
$ showspeed dd
dd looks like a process name. pid=4417 matches av0=dd.
p/4417/fd/0r /home/jw/bigfile 113MB/s (12%, 2.3GB) 9m:35
p/4417/fd/1w /tmp/otherbigfile 182MB/s (2.6GB)
p/4417/fd/0r /home/jw/bigfile 285MB/s (15%, 3.0GB) 8m:08
p/4417/fd/0r /home/jw/bigfile 115MB/s (16%, 3.2GB) 8m:01
p/4417/fd/0r /home/jw/bigfile 107MB/s (17%, 3.4GB) 7m:39
p/4417/fd/1w /tmp/otherbigfile 104MB/s (3.5GB)
p/4417/fd/0r /home/jw/bigfile 139MB/s (19%, 3.7GB) 7m:37
p/4417/fd/0r /home/jw/bigfile 116MB/s (20%, 3.9GB) 7m:18
p/4417/fd/1w /tmp/otherbigfile 67MB/s (4.0GB)
p/4417/fd/1w /tmp/otherbigfile 100MB/s (4.1GB)
...
Nice one. How does it work out percentages though? I guess only in case of file s open as read only? And it will probably not work in case of scattered access.
– j_kubik
Dec 22 '14 at 17:29
1
In this case you can also use another terminal to runpkill -USR1 dd
to makedd
show its status, another option would bewatch -n 1 pkill -USR1 dd
to make it show its progress periodically (every second).
– Yaron
Mar 16 '15 at 9:23
Right. Many tools got a builtin way to report statistics over time. dd is no exception. Modern implementations have a status=progess option. Showspeed is a classic unix style "one tool for one purpose" solution - just like pv. But it has different usecases: Think of cups pumping a file through ghostscript or you want to know the ETA for an ongoing cp or tar. It might be 95% done already after a few hours and you probably don't want to restart that just to add pv ... Scattered access would not work well. Showspeed only samples seek positions.
– Jürgen Weigert
Apr 30 '18 at 19:22
add a comment |
There is a tool called progress
in the repositories that is able to examine various different commands and display progress info for them.
Install it using the command
sudo apt-get install progress
This tool can be used like that:
cp bigfile newfile & progress -mp $!
Output:
[11471] cp /media/Backup/Downloads/FILENAME.file
29.9% (24.2 MiB / 16 MiB)
add a comment |
While pv
can deal with local cp
tasks, using dd
with pv
can deal with both local (cp
) and remote (scp
) tasks.
dd if=path/to/source.mkv | pv | dd of=path/to/dest.mkv
Please ensure the path/to/dest.mkv
exits by touch path/to/dest.mkv
This can show the progress, but if you want the percentage information,
dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
Replace 100M
above with the real size of your source file.
Here Comes the Remote Part
While scp
can hardly show current progress, using dd
with pv
is a piece of cake.
ssh onemach@myotherhost dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
1
Newerdd
hasstatus=progress
: askubuntu.com/a/824895/52975
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 14 '16 at 16:20
add a comment |
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
cv -w
outputs the stats for all running cp,mv etc. operations
watch cv -q
is even neater
– nwgat
Jan 19 '15 at 0:42
It only show progress for an individual files, it does realise whether acp
is copying a directory recursively or not.
– Flimm
Mar 31 '16 at 9:27
It war renamed to progress. Great tool!
– sebastian
Jun 25 '16 at 14:42
add a comment |
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 -R
):
See how big the file is and remember
Start copying
Open another terminal
Run
watch ls -lh DIR
on the directory where the target is
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 watch du -hs DIR
to see summary of DIR size. However du can take long to compute and can even slow down the copying, so you might want to use -n INTERVAL
argument to watch so that trade-off is acceptable.
Update: In case you use wild-cards with command used with watch du, e.g. watch du -hs backup/*
, don't forget to quote:
watch "du -hs backup/*"
otherwise the wild-cards will be expanded only once, when watch is started so du will not look at new files / subdirectories.
Does not answer the "speed" part, though...
– Alois Mahdal
Nov 16 '12 at 13:21
add a comment |
dd status=progress
Option added in GNU Coreutils 8.24+ (Ubuntu 16.04):
dd if=src of=dst status=progress
The terminal shows a line of type:
462858752 bytes (463 MB, 441 MiB) copied, 38 s, 12,2 MB/s
See also: How do you monitor the progress of dd?
1
You meant: stdout is a stream of characters and vt100 escape sequences that make your terminal display a periodically updated line ;). stdout is always a stream of bytes and has nothing to do with how it is displayed (except that the application can know whether it is currently attached to a terminal or not...)
– masterxilo
Sep 4 '18 at 9:20
@masterxilo newbs won't care, experts will know ;-) hehe
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 4 '18 at 9:33
Well I think it's always good to state things like they are, maybe leaving out some details, but never make your readers produce a wrong mental model. If you say "stdout is a (periodically updated) line" it seems like you are saying stdout is a block of mutable memory which it is not. This is important to know even for newbies.
– masterxilo
Sep 7 '18 at 9:09
add a comment |
Depending on what you want to do, Midnight Commander (mc
) might be the answer. I'm surprised it's not been mentioned yet.
Tools like pv
or rsync
are good to display progress of transfer of one huge file, but when it comes to copying whole directories/trees, mc
calculates the size and then displays the progress very nicely. Plus it's available out of the box on majority of systems.
1
"it's available out of the box on majority of systems." ... not on any default Ubuntu installation.
– muru
Jan 30 '16 at 17:58
add a comment |
If you have rsync 3.1 or higher (rsync --version
), you can copy (cp -Rpn) while preserving permissions and ownership, recurse directories, "no clobber," and display overall progress (instead of just progress by file), copy rate, and (very rough) estimated time remaining with:
sudo rsync -a --info=progress2 --no-i-r /source /destination
Note that sudo is only needed if dealing with directories/files you don't own. Also, without the --no-i-r
, the percentage may reset to a lower number at some point during the copy. Perhaps later versions of rsync will default to no-i-r with info=progress2, but it does not in the current version of 3.1.2.
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").
add a comment |
Use a shell script:
#!/bin/sh
cp_p()
{
strace -q -ewrite cp -- "${1}" "${2}" 2>&1
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
printf "%3d%% [", percent
for (i=0;i<=percent;i++)
printf "="
printf ">"
for (i=percent;i<100;i++)
printf " "
printf "]r"
}
}
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
}
This will look like:
% cp_p /home/echox/foo.dat /home/echox/bar.dat
66% [===============================> ]
Source
add a comment |
one more option to preserve attributes could be (if source
is a folder it will be created in destination
)
tar -c source | pv -e -t -p -r | tar -C destination -x
hope it may be useful to someone. To have estimated transfer time this can be acheived by doing do -s source
in advance and passing it as a -s <size>
parameter to pv
.
-f -
is redundant.tar
's default output forc
and input forx
are stdout and stdin.
– muru
Oct 17 '18 at 16:34
May it depend on the OS/tar version? I know it’s an Ubuntu site yet this may be useful for other OS owners like macOS
– ciekawy
Oct 17 '18 at 16:39
1
Nope. All sane implementations (including libarchive's tar, which macOS uses) have this behaviour.
– muru
Oct 17 '18 at 16:46
just verified on macos and your suggestion is perfectly valid - I've updated my answer. Thanks!
– ciekawy
Oct 17 '18 at 17:21
add a comment |
You can copy use any program. At the same time, you can start sudo iotop
and see the actually disk read/write speed yet without progress.
add a comment |
Check the source code for progress_bar in the below git repository
https://github.com/Kiran-Bose/supreme
Also try the custom bash script package supreme
Download the deb file and install in debian based distribution or download the source files, modify and use for other distros
Functionality overview
(1)Open Apps
----Firefox
----Calculator
----Settings
(2)Manage Files
----Search
----Navigate
----Quick access
|----Select File(s)
|----Inverse Selection
|----Make directory
|----Make file
|----Open
|----Copy
|----Move
|----Delete
|----Rename
|----Send to Device
|----Properties
(3)Manage Phone
----Move/Copy from phone
----Move/Copy to phone
----Sync folders
(4)Manage USB
----Move/Copy from USB
----Move/Copy to USB
add a comment |
pv knows how to watch file descriptors given a pid, whether it's cp or something else
From the documentation:
(Linux only): Watching file descriptor 3 opened by another process 1234:
pv -d 1234:3
(Linux only): Watching all file descriptors used by process 1234:
pv -d 1234
Example:
md5sum file &
[1] + 1271 suspended
pv -d 1271
417MiB 0:00:17 [12,1MiB/s] [============> ] 29% ETA 0:00:53
$ cp file.mov copy.mov &
[2] 3731
$ pv -d 3731
3:/media/windows/file.mov: 754MiB 0:00:04 [97,2MiB/s] [======================> ] 52% ETA 0:00:07
4:/media/windows/copy.mov: 754MiB 0:00:04 [97,3MiB/s] [ <=> ]
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f17275%2fhow-to-show-the-transfer-progress-and-speed-when-copying-files-with-cp%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
18 Answers
18
active
oldest
votes
18 Answers
18
active
oldest
votes
active
oldest
votes
active
oldest
votes
While cp
hasn't got this functionality, you can use pv
to do this:
pv my_big_file > backup/my_big_file
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, pv
basically just outputs the file to stdout*, which you redirect to a file using the >
operator. Simultaneously, it prints information about the progress to the terminal when you do that.
This is what it looks like:
stefano@ubuntu:~/Data$ pv my_big_file > backup/my_big_file
138MB 0:00:01 [73.3MB/s] [=================================>] 100%
You may need to Install pv (alternatively, type sudo apt-get install pv
) on your system.
*: 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 >
redirection operator redirects program output to a file. Without arguments, as you see above, >
redirects a program's standard output to a file. cp
basically does nothing fancier than
cat source > destination
(where cat
just reads a file and prints it to stdout). pv
is just like cat, but if you redirect it's output stream somewhere else, it will print progress information to stdout instead.
Take a look at man pv
to learn more about it.
Another option, as DoR suggests in this answer, is to use rsync instead:
$ rsync -ah --progress source-file destination-file
sending incremental file list
source-file
621.22M 57% 283.86MB/s 0:00:01
This will preserve the files permissions/ownership while showing progress.
3
It may or may no be significant (depending on the situation), butpv
does not handle permissions the same way ascp
does... (based on one quick test I tried:pv
didn't copy the execute bit across..rsync
did.
– Peter.O
Dec 14 '10 at 15:55
41
IMO:alias cp="rsync -avz"
cp is outdated.
– Marco Ceppi♦
Dec 26 '10 at 1:26
10
If you're like me, and forget aboutpv
, you can go snooping in/proc/PID of cp/fd
and/proc/PID of cp/fdinfo
to figure out progress. (It's up to you to infer speed.) I use this technique to watchupdatedb
.
– Thanatos
Dec 26 '10 at 1:30
6
Yes,-z
should probably only be used for network copies; compressing and decompressing the data for a local copy is pure overhead.
– Matthew Read
Jun 17 '15 at 15:17
2
@MarcoCeppi , when copying directory withrsync
be sure not to add trailing/
to source path (or remove if e.g. bash completion put it there automatically). Otherwise you will get results different than when usingcp
(orgcp
).
– Piotr Findeisen
Apr 3 '16 at 19:07
|
show 10 more comments
While cp
hasn't got this functionality, you can use pv
to do this:
pv my_big_file > backup/my_big_file
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, pv
basically just outputs the file to stdout*, which you redirect to a file using the >
operator. Simultaneously, it prints information about the progress to the terminal when you do that.
This is what it looks like:
stefano@ubuntu:~/Data$ pv my_big_file > backup/my_big_file
138MB 0:00:01 [73.3MB/s] [=================================>] 100%
You may need to Install pv (alternatively, type sudo apt-get install pv
) on your system.
*: 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 >
redirection operator redirects program output to a file. Without arguments, as you see above, >
redirects a program's standard output to a file. cp
basically does nothing fancier than
cat source > destination
(where cat
just reads a file and prints it to stdout). pv
is just like cat, but if you redirect it's output stream somewhere else, it will print progress information to stdout instead.
Take a look at man pv
to learn more about it.
Another option, as DoR suggests in this answer, is to use rsync instead:
$ rsync -ah --progress source-file destination-file
sending incremental file list
source-file
621.22M 57% 283.86MB/s 0:00:01
This will preserve the files permissions/ownership while showing progress.
3
It may or may no be significant (depending on the situation), butpv
does not handle permissions the same way ascp
does... (based on one quick test I tried:pv
didn't copy the execute bit across..rsync
did.
– Peter.O
Dec 14 '10 at 15:55
41
IMO:alias cp="rsync -avz"
cp is outdated.
– Marco Ceppi♦
Dec 26 '10 at 1:26
10
If you're like me, and forget aboutpv
, you can go snooping in/proc/PID of cp/fd
and/proc/PID of cp/fdinfo
to figure out progress. (It's up to you to infer speed.) I use this technique to watchupdatedb
.
– Thanatos
Dec 26 '10 at 1:30
6
Yes,-z
should probably only be used for network copies; compressing and decompressing the data for a local copy is pure overhead.
– Matthew Read
Jun 17 '15 at 15:17
2
@MarcoCeppi , when copying directory withrsync
be sure not to add trailing/
to source path (or remove if e.g. bash completion put it there automatically). Otherwise you will get results different than when usingcp
(orgcp
).
– Piotr Findeisen
Apr 3 '16 at 19:07
|
show 10 more comments
While cp
hasn't got this functionality, you can use pv
to do this:
pv my_big_file > backup/my_big_file
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, pv
basically just outputs the file to stdout*, which you redirect to a file using the >
operator. Simultaneously, it prints information about the progress to the terminal when you do that.
This is what it looks like:
stefano@ubuntu:~/Data$ pv my_big_file > backup/my_big_file
138MB 0:00:01 [73.3MB/s] [=================================>] 100%
You may need to Install pv (alternatively, type sudo apt-get install pv
) on your system.
*: 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 >
redirection operator redirects program output to a file. Without arguments, as you see above, >
redirects a program's standard output to a file. cp
basically does nothing fancier than
cat source > destination
(where cat
just reads a file and prints it to stdout). pv
is just like cat, but if you redirect it's output stream somewhere else, it will print progress information to stdout instead.
Take a look at man pv
to learn more about it.
Another option, as DoR suggests in this answer, is to use rsync instead:
$ rsync -ah --progress source-file destination-file
sending incremental file list
source-file
621.22M 57% 283.86MB/s 0:00:01
This will preserve the files permissions/ownership while showing progress.
While cp
hasn't got this functionality, you can use pv
to do this:
pv my_big_file > backup/my_big_file
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, pv
basically just outputs the file to stdout*, which you redirect to a file using the >
operator. Simultaneously, it prints information about the progress to the terminal when you do that.
This is what it looks like:
stefano@ubuntu:~/Data$ pv my_big_file > backup/my_big_file
138MB 0:00:01 [73.3MB/s] [=================================>] 100%
You may need to Install pv (alternatively, type sudo apt-get install pv
) on your system.
*: 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 >
redirection operator redirects program output to a file. Without arguments, as you see above, >
redirects a program's standard output to a file. cp
basically does nothing fancier than
cat source > destination
(where cat
just reads a file and prints it to stdout). pv
is just like cat, but if you redirect it's output stream somewhere else, it will print progress information to stdout instead.
Take a look at man pv
to learn more about it.
Another option, as DoR suggests in this answer, is to use rsync instead:
$ rsync -ah --progress source-file destination-file
sending incremental file list
source-file
621.22M 57% 283.86MB/s 0:00:01
This will preserve the files permissions/ownership while showing progress.
edited Jun 24 '18 at 8:49
muru
1
1
answered Dec 14 '10 at 5:17
Stefano Palazzo♦Stefano Palazzo
63.1k33183216
63.1k33183216
3
It may or may no be significant (depending on the situation), butpv
does not handle permissions the same way ascp
does... (based on one quick test I tried:pv
didn't copy the execute bit across..rsync
did.
– Peter.O
Dec 14 '10 at 15:55
41
IMO:alias cp="rsync -avz"
cp is outdated.
– Marco Ceppi♦
Dec 26 '10 at 1:26
10
If you're like me, and forget aboutpv
, you can go snooping in/proc/PID of cp/fd
and/proc/PID of cp/fdinfo
to figure out progress. (It's up to you to infer speed.) I use this technique to watchupdatedb
.
– Thanatos
Dec 26 '10 at 1:30
6
Yes,-z
should probably only be used for network copies; compressing and decompressing the data for a local copy is pure overhead.
– Matthew Read
Jun 17 '15 at 15:17
2
@MarcoCeppi , when copying directory withrsync
be sure not to add trailing/
to source path (or remove if e.g. bash completion put it there automatically). Otherwise you will get results different than when usingcp
(orgcp
).
– Piotr Findeisen
Apr 3 '16 at 19:07
|
show 10 more comments
3
It may or may no be significant (depending on the situation), butpv
does not handle permissions the same way ascp
does... (based on one quick test I tried:pv
didn't copy the execute bit across..rsync
did.
– Peter.O
Dec 14 '10 at 15:55
41
IMO:alias cp="rsync -avz"
cp is outdated.
– Marco Ceppi♦
Dec 26 '10 at 1:26
10
If you're like me, and forget aboutpv
, you can go snooping in/proc/PID of cp/fd
and/proc/PID of cp/fdinfo
to figure out progress. (It's up to you to infer speed.) I use this technique to watchupdatedb
.
– Thanatos
Dec 26 '10 at 1:30
6
Yes,-z
should probably only be used for network copies; compressing and decompressing the data for a local copy is pure overhead.
– Matthew Read
Jun 17 '15 at 15:17
2
@MarcoCeppi , when copying directory withrsync
be sure not to add trailing/
to source path (or remove if e.g. bash completion put it there automatically). Otherwise you will get results different than when usingcp
(orgcp
).
– Piotr Findeisen
Apr 3 '16 at 19:07
3
3
It may or may no be significant (depending on the situation), but
pv
does not handle permissions the same way as cp
does... (based on one quick test I tried: pv
didn't copy the execute bit across.. rsync
did.– Peter.O
Dec 14 '10 at 15:55
It may or may no be significant (depending on the situation), but
pv
does not handle permissions the same way as cp
does... (based on one quick test I tried: pv
didn't copy the execute bit across.. rsync
did.– Peter.O
Dec 14 '10 at 15:55
41
41
IMO:
alias cp="rsync -avz"
cp is outdated.– Marco Ceppi♦
Dec 26 '10 at 1:26
IMO:
alias cp="rsync -avz"
cp is outdated.– Marco Ceppi♦
Dec 26 '10 at 1:26
10
10
If you're like me, and forget about
pv
, you can go snooping in /proc/PID of cp/fd
and /proc/PID of cp/fdinfo
to figure out progress. (It's up to you to infer speed.) I use this technique to watch updatedb
.– Thanatos
Dec 26 '10 at 1:30
If you're like me, and forget about
pv
, you can go snooping in /proc/PID of cp/fd
and /proc/PID of cp/fdinfo
to figure out progress. (It's up to you to infer speed.) I use this technique to watch updatedb
.– Thanatos
Dec 26 '10 at 1:30
6
6
Yes,
-z
should probably only be used for network copies; compressing and decompressing the data for a local copy is pure overhead.– Matthew Read
Jun 17 '15 at 15:17
Yes,
-z
should probably only be used for network copies; compressing and decompressing the data for a local copy is pure overhead.– Matthew Read
Jun 17 '15 at 15:17
2
2
@MarcoCeppi , when copying directory with
rsync
be sure not to add trailing /
to source path (or remove if e.g. bash completion put it there automatically). Otherwise you will get results different than when using cp
(or gcp
).– Piotr Findeisen
Apr 3 '16 at 19:07
@MarcoCeppi , when copying directory with
rsync
be sure not to add trailing /
to source path (or remove if e.g. bash completion put it there automatically). Otherwise you will get results different than when using cp
(or gcp
).– Piotr Findeisen
Apr 3 '16 at 19:07
|
show 10 more comments
There isn't. See here as to why. Although it does more than you need, rsync has one with --progress
parameter. The -a will keep permissions,etc, and -h will be human readable.
rsync -ah --progress source destination
The output will look something like this:
Pictures/1.jpg
2.13M 100% 2.28MB/s 0:00:00 (xfr#5898, to-chk=1/5905)
Pictures/2.jpg
1.68M 100% 1.76MB/s 0:00:00 (xfr#5899, to-chk=0/5905)
4
This works great in the current Ubuntu (14.10). It also supports the-r
flag to recurse directories. It can even be aliased as a direct replacement for cp:alias cp="rsync -ah --progress"
– rustyx
Dec 23 '14 at 21:04
1
Works swell on OS X, with the bonus of being able to use tools included with the system.
– Ivan X
Apr 24 '15 at 20:11
this is great, the output looks likefilename MB-copied MB-speed time-remaining)
– Rudolf Olah
May 21 '17 at 15:20
2
i like this alternative better than pv, specially because rsync is part of the standard install
– Joao Costa
Sep 17 '17 at 18:31
@bartekbrak thanks for sharing. I'm presently on macOS 10.12.x running homebrew version of rsync 3.1.2 and using--progress
makes my head spin 🙃 watching all the output display in the terminal. So those coming here from AOL keyword searches,rsync -ah --info=progress2 [source] [destination]
presents the output in a little more sane 👩⚕️ manner IMHO.
– ipatch
Mar 1 '18 at 19:53
|
show 2 more comments
There isn't. See here as to why. Although it does more than you need, rsync has one with --progress
parameter. The -a will keep permissions,etc, and -h will be human readable.
rsync -ah --progress source destination
The output will look something like this:
Pictures/1.jpg
2.13M 100% 2.28MB/s 0:00:00 (xfr#5898, to-chk=1/5905)
Pictures/2.jpg
1.68M 100% 1.76MB/s 0:00:00 (xfr#5899, to-chk=0/5905)
4
This works great in the current Ubuntu (14.10). It also supports the-r
flag to recurse directories. It can even be aliased as a direct replacement for cp:alias cp="rsync -ah --progress"
– rustyx
Dec 23 '14 at 21:04
1
Works swell on OS X, with the bonus of being able to use tools included with the system.
– Ivan X
Apr 24 '15 at 20:11
this is great, the output looks likefilename MB-copied MB-speed time-remaining)
– Rudolf Olah
May 21 '17 at 15:20
2
i like this alternative better than pv, specially because rsync is part of the standard install
– Joao Costa
Sep 17 '17 at 18:31
@bartekbrak thanks for sharing. I'm presently on macOS 10.12.x running homebrew version of rsync 3.1.2 and using--progress
makes my head spin 🙃 watching all the output display in the terminal. So those coming here from AOL keyword searches,rsync -ah --info=progress2 [source] [destination]
presents the output in a little more sane 👩⚕️ manner IMHO.
– ipatch
Mar 1 '18 at 19:53
|
show 2 more comments
There isn't. See here as to why. Although it does more than you need, rsync has one with --progress
parameter. The -a will keep permissions,etc, and -h will be human readable.
rsync -ah --progress source destination
The output will look something like this:
Pictures/1.jpg
2.13M 100% 2.28MB/s 0:00:00 (xfr#5898, to-chk=1/5905)
Pictures/2.jpg
1.68M 100% 1.76MB/s 0:00:00 (xfr#5899, to-chk=0/5905)
There isn't. See here as to why. Although it does more than you need, rsync has one with --progress
parameter. The -a will keep permissions,etc, and -h will be human readable.
rsync -ah --progress source destination
The output will look something like this:
Pictures/1.jpg
2.13M 100% 2.28MB/s 0:00:00 (xfr#5898, to-chk=1/5905)
Pictures/2.jpg
1.68M 100% 1.76MB/s 0:00:00 (xfr#5899, to-chk=0/5905)
edited May 21 '17 at 16:55
Rudolf Olah
42841527
42841527
answered Oct 15 '12 at 8:06
bartekbrakbartekbrak
2,31511120
2,31511120
4
This works great in the current Ubuntu (14.10). It also supports the-r
flag to recurse directories. It can even be aliased as a direct replacement for cp:alias cp="rsync -ah --progress"
– rustyx
Dec 23 '14 at 21:04
1
Works swell on OS X, with the bonus of being able to use tools included with the system.
– Ivan X
Apr 24 '15 at 20:11
this is great, the output looks likefilename MB-copied MB-speed time-remaining)
– Rudolf Olah
May 21 '17 at 15:20
2
i like this alternative better than pv, specially because rsync is part of the standard install
– Joao Costa
Sep 17 '17 at 18:31
@bartekbrak thanks for sharing. I'm presently on macOS 10.12.x running homebrew version of rsync 3.1.2 and using--progress
makes my head spin 🙃 watching all the output display in the terminal. So those coming here from AOL keyword searches,rsync -ah --info=progress2 [source] [destination]
presents the output in a little more sane 👩⚕️ manner IMHO.
– ipatch
Mar 1 '18 at 19:53
|
show 2 more comments
4
This works great in the current Ubuntu (14.10). It also supports the-r
flag to recurse directories. It can even be aliased as a direct replacement for cp:alias cp="rsync -ah --progress"
– rustyx
Dec 23 '14 at 21:04
1
Works swell on OS X, with the bonus of being able to use tools included with the system.
– Ivan X
Apr 24 '15 at 20:11
this is great, the output looks likefilename MB-copied MB-speed time-remaining)
– Rudolf Olah
May 21 '17 at 15:20
2
i like this alternative better than pv, specially because rsync is part of the standard install
– Joao Costa
Sep 17 '17 at 18:31
@bartekbrak thanks for sharing. I'm presently on macOS 10.12.x running homebrew version of rsync 3.1.2 and using--progress
makes my head spin 🙃 watching all the output display in the terminal. So those coming here from AOL keyword searches,rsync -ah --info=progress2 [source] [destination]
presents the output in a little more sane 👩⚕️ manner IMHO.
– ipatch
Mar 1 '18 at 19:53
4
4
This works great in the current Ubuntu (14.10). It also supports the
-r
flag to recurse directories. It can even be aliased as a direct replacement for cp: alias cp="rsync -ah --progress"
– rustyx
Dec 23 '14 at 21:04
This works great in the current Ubuntu (14.10). It also supports the
-r
flag to recurse directories. It can even be aliased as a direct replacement for cp: alias cp="rsync -ah --progress"
– rustyx
Dec 23 '14 at 21:04
1
1
Works swell on OS X, with the bonus of being able to use tools included with the system.
– Ivan X
Apr 24 '15 at 20:11
Works swell on OS X, with the bonus of being able to use tools included with the system.
– Ivan X
Apr 24 '15 at 20:11
this is great, the output looks like
filename MB-copied MB-speed time-remaining)
– Rudolf Olah
May 21 '17 at 15:20
this is great, the output looks like
filename MB-copied MB-speed time-remaining)
– Rudolf Olah
May 21 '17 at 15:20
2
2
i like this alternative better than pv, specially because rsync is part of the standard install
– Joao Costa
Sep 17 '17 at 18:31
i like this alternative better than pv, specially because rsync is part of the standard install
– Joao Costa
Sep 17 '17 at 18:31
@bartekbrak thanks for sharing. I'm presently on macOS 10.12.x running homebrew version of rsync 3.1.2 and using
--progress
makes my head spin 🙃 watching all the output display in the terminal. So those coming here from AOL keyword searches, rsync -ah --info=progress2 [source] [destination]
presents the output in a little more sane 👩⚕️ manner IMHO.– ipatch
Mar 1 '18 at 19:53
@bartekbrak thanks for sharing. I'm presently on macOS 10.12.x running homebrew version of rsync 3.1.2 and using
--progress
makes my head spin 🙃 watching all the output display in the terminal. So those coming here from AOL keyword searches, rsync -ah --info=progress2 [source] [destination]
presents the output in a little more sane 👩⚕️ manner IMHO.– ipatch
Mar 1 '18 at 19:53
|
show 2 more comments
If you want to see if your files are transferring correctly you could use gcp
and gcp
is like cp but by default gives you a progress bar so that you can see what is being copied. As the program's wiki notes, gcp
has several useful features such as
- transfer progression indication
- continuous copying on error (skip to next file)
- copy status logging: gcp logs all its actions so that it is possible to know which files have been successfully copied
- name mangling to handle target filesystem limitations (for example deletion of incompatible characters "*" or "?" on FAT)
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.
gcp
is used to copy files and has options such as --preserve
so that various attributes and permissions can be preserved and --recursive
so that whole directories can be copied. More information on its options can be found by entering man gcp
or by going to the Ubuntu manpages online. A tutorial is also available on this site.
Install gcp
from the repositories with
sudo apt-get install gcp
(Note: in Ubuntu 12.10 the new automount point is, for example, /media/user/usbdisk
)
You can copy a file to your media by entering
gcp /home/mike/file.mp4 /media/usb
and copy a folder to your media with
gcp -rv ~/Podcasts /media/Mik2
Sample output from gcp
with the progress bar:
gcp ~/Videos_incIplayer/mars.flv /media/Mik2
Copying 168.57 MiB 100% |########################################################| 7.98 M/s Time: 00:00:22
You can of course specify multiple files or folders to copy to your disk, and there are a lot of other options covered in man gcp
.
4
Got error with it over sshdbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
– msa7
Jan 17 '16 at 23:29
3
if you have a X11 display open on the machine you can just setexport DISPLAY=:0.0
before starting gcp. If the machine is headless then you'd have to start a xsession into a virtual framebuffer or something, at that point you should probably just look for another program
– user292067
Oct 9 '16 at 17:33
1
gcp
is pretty decent but the DBUS/X requirement is odd. I handled this over SSH by using ssh forwarding:ssh -X user@host
and that allowed me to run it.
– Oli♦
Oct 21 '16 at 12:24
add a comment |
If you want to see if your files are transferring correctly you could use gcp
and gcp
is like cp but by default gives you a progress bar so that you can see what is being copied. As the program's wiki notes, gcp
has several useful features such as
- transfer progression indication
- continuous copying on error (skip to next file)
- copy status logging: gcp logs all its actions so that it is possible to know which files have been successfully copied
- name mangling to handle target filesystem limitations (for example deletion of incompatible characters "*" or "?" on FAT)
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.
gcp
is used to copy files and has options such as --preserve
so that various attributes and permissions can be preserved and --recursive
so that whole directories can be copied. More information on its options can be found by entering man gcp
or by going to the Ubuntu manpages online. A tutorial is also available on this site.
Install gcp
from the repositories with
sudo apt-get install gcp
(Note: in Ubuntu 12.10 the new automount point is, for example, /media/user/usbdisk
)
You can copy a file to your media by entering
gcp /home/mike/file.mp4 /media/usb
and copy a folder to your media with
gcp -rv ~/Podcasts /media/Mik2
Sample output from gcp
with the progress bar:
gcp ~/Videos_incIplayer/mars.flv /media/Mik2
Copying 168.57 MiB 100% |########################################################| 7.98 M/s Time: 00:00:22
You can of course specify multiple files or folders to copy to your disk, and there are a lot of other options covered in man gcp
.
4
Got error with it over sshdbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
– msa7
Jan 17 '16 at 23:29
3
if you have a X11 display open on the machine you can just setexport DISPLAY=:0.0
before starting gcp. If the machine is headless then you'd have to start a xsession into a virtual framebuffer or something, at that point you should probably just look for another program
– user292067
Oct 9 '16 at 17:33
1
gcp
is pretty decent but the DBUS/X requirement is odd. I handled this over SSH by using ssh forwarding:ssh -X user@host
and that allowed me to run it.
– Oli♦
Oct 21 '16 at 12:24
add a comment |
If you want to see if your files are transferring correctly you could use gcp
and gcp
is like cp but by default gives you a progress bar so that you can see what is being copied. As the program's wiki notes, gcp
has several useful features such as
- transfer progression indication
- continuous copying on error (skip to next file)
- copy status logging: gcp logs all its actions so that it is possible to know which files have been successfully copied
- name mangling to handle target filesystem limitations (for example deletion of incompatible characters "*" or "?" on FAT)
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.
gcp
is used to copy files and has options such as --preserve
so that various attributes and permissions can be preserved and --recursive
so that whole directories can be copied. More information on its options can be found by entering man gcp
or by going to the Ubuntu manpages online. A tutorial is also available on this site.
Install gcp
from the repositories with
sudo apt-get install gcp
(Note: in Ubuntu 12.10 the new automount point is, for example, /media/user/usbdisk
)
You can copy a file to your media by entering
gcp /home/mike/file.mp4 /media/usb
and copy a folder to your media with
gcp -rv ~/Podcasts /media/Mik2
Sample output from gcp
with the progress bar:
gcp ~/Videos_incIplayer/mars.flv /media/Mik2
Copying 168.57 MiB 100% |########################################################| 7.98 M/s Time: 00:00:22
You can of course specify multiple files or folders to copy to your disk, and there are a lot of other options covered in man gcp
.
If you want to see if your files are transferring correctly you could use gcp
and gcp
is like cp but by default gives you a progress bar so that you can see what is being copied. As the program's wiki notes, gcp
has several useful features such as
- transfer progression indication
- continuous copying on error (skip to next file)
- copy status logging: gcp logs all its actions so that it is possible to know which files have been successfully copied
- name mangling to handle target filesystem limitations (for example deletion of incompatible characters "*" or "?" on FAT)
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.
gcp
is used to copy files and has options such as --preserve
so that various attributes and permissions can be preserved and --recursive
so that whole directories can be copied. More information on its options can be found by entering man gcp
or by going to the Ubuntu manpages online. A tutorial is also available on this site.
Install gcp
from the repositories with
sudo apt-get install gcp
(Note: in Ubuntu 12.10 the new automount point is, for example, /media/user/usbdisk
)
You can copy a file to your media by entering
gcp /home/mike/file.mp4 /media/usb
and copy a folder to your media with
gcp -rv ~/Podcasts /media/Mik2
Sample output from gcp
with the progress bar:
gcp ~/Videos_incIplayer/mars.flv /media/Mik2
Copying 168.57 MiB 100% |########################################################| 7.98 M/s Time: 00:00:22
You can of course specify multiple files or folders to copy to your disk, and there are a lot of other options covered in man gcp
.
edited Oct 22 '12 at 12:51
answered Oct 15 '12 at 11:09
user76204
4
Got error with it over sshdbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
– msa7
Jan 17 '16 at 23:29
3
if you have a X11 display open on the machine you can just setexport DISPLAY=:0.0
before starting gcp. If the machine is headless then you'd have to start a xsession into a virtual framebuffer or something, at that point you should probably just look for another program
– user292067
Oct 9 '16 at 17:33
1
gcp
is pretty decent but the DBUS/X requirement is odd. I handled this over SSH by using ssh forwarding:ssh -X user@host
and that allowed me to run it.
– Oli♦
Oct 21 '16 at 12:24
add a comment |
4
Got error with it over sshdbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
– msa7
Jan 17 '16 at 23:29
3
if you have a X11 display open on the machine you can just setexport DISPLAY=:0.0
before starting gcp. If the machine is headless then you'd have to start a xsession into a virtual framebuffer or something, at that point you should probably just look for another program
– user292067
Oct 9 '16 at 17:33
1
gcp
is pretty decent but the DBUS/X requirement is odd. I handled this over SSH by using ssh forwarding:ssh -X user@host
and that allowed me to run it.
– Oli♦
Oct 21 '16 at 12:24
4
4
Got error with it over ssh
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
– msa7
Jan 17 '16 at 23:29
Got error with it over ssh
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
– msa7
Jan 17 '16 at 23:29
3
3
if you have a X11 display open on the machine you can just set
export DISPLAY=:0.0
before starting gcp. If the machine is headless then you'd have to start a xsession into a virtual framebuffer or something, at that point you should probably just look for another program– user292067
Oct 9 '16 at 17:33
if you have a X11 display open on the machine you can just set
export DISPLAY=:0.0
before starting gcp. If the machine is headless then you'd have to start a xsession into a virtual framebuffer or something, at that point you should probably just look for another program– user292067
Oct 9 '16 at 17:33
1
1
gcp
is pretty decent but the DBUS/X requirement is odd. I handled this over SSH by using ssh forwarding: ssh -X user@host
and that allowed me to run it.– Oli♦
Oct 21 '16 at 12:24
gcp
is pretty decent but the DBUS/X requirement is odd. I handled this over SSH by using ssh forwarding: ssh -X user@host
and that allowed me to run it.– Oli♦
Oct 21 '16 at 12:24
add a comment |
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:
curl -o destination FILE://source
Speed, progress, time remaining, and more -- all in a familiar format.
1
This is great especially in environments where you are prohibited from installing new tools and where rsync is unavailable.
– user190264
Sep 5 '13 at 7:00
5
Brilliant, this has got to be a must-known hack!
– ionreflex
Oct 20 '15 at 18:13
Nice answer! Clever!
– 9301293
Jan 10 '18 at 20:48
This presumably has the same drawback aspv
, that it won't save permissions.
– Ploni
Jul 9 '18 at 0:09
add a comment |
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:
curl -o destination FILE://source
Speed, progress, time remaining, and more -- all in a familiar format.
1
This is great especially in environments where you are prohibited from installing new tools and where rsync is unavailable.
– user190264
Sep 5 '13 at 7:00
5
Brilliant, this has got to be a must-known hack!
– ionreflex
Oct 20 '15 at 18:13
Nice answer! Clever!
– 9301293
Jan 10 '18 at 20:48
This presumably has the same drawback aspv
, that it won't save permissions.
– Ploni
Jul 9 '18 at 0:09
add a comment |
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:
curl -o destination FILE://source
Speed, progress, time remaining, and more -- all in a familiar format.
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:
curl -o destination FILE://source
Speed, progress, time remaining, and more -- all in a familiar format.
answered Feb 2 '13 at 9:00
mathemagicianmathemagician
61152
61152
1
This is great especially in environments where you are prohibited from installing new tools and where rsync is unavailable.
– user190264
Sep 5 '13 at 7:00
5
Brilliant, this has got to be a must-known hack!
– ionreflex
Oct 20 '15 at 18:13
Nice answer! Clever!
– 9301293
Jan 10 '18 at 20:48
This presumably has the same drawback aspv
, that it won't save permissions.
– Ploni
Jul 9 '18 at 0:09
add a comment |
1
This is great especially in environments where you are prohibited from installing new tools and where rsync is unavailable.
– user190264
Sep 5 '13 at 7:00
5
Brilliant, this has got to be a must-known hack!
– ionreflex
Oct 20 '15 at 18:13
Nice answer! Clever!
– 9301293
Jan 10 '18 at 20:48
This presumably has the same drawback aspv
, that it won't save permissions.
– Ploni
Jul 9 '18 at 0:09
1
1
This is great especially in environments where you are prohibited from installing new tools and where rsync is unavailable.
– user190264
Sep 5 '13 at 7:00
This is great especially in environments where you are prohibited from installing new tools and where rsync is unavailable.
– user190264
Sep 5 '13 at 7:00
5
5
Brilliant, this has got to be a must-known hack!
– ionreflex
Oct 20 '15 at 18:13
Brilliant, this has got to be a must-known hack!
– ionreflex
Oct 20 '15 at 18:13
Nice answer! Clever!
– 9301293
Jan 10 '18 at 20:48
Nice answer! Clever!
– 9301293
Jan 10 '18 at 20:48
This presumably has the same drawback as
pv
, that it won't save permissions.– Ploni
Jul 9 '18 at 0:09
This presumably has the same drawback as
pv
, that it won't save permissions.– Ploni
Jul 9 '18 at 0:09
add a comment |
While it doesn't display speed, when copying multiple files, the -v
option to the cp
command will provide you with progress info. e.g.
cp -rv old-directory new-directory
6
Progress info? This is just verbose output. To provide progress info you would at least need to now how many files, or even which files, needs to be copied.
– Julian F. Weinert
Jul 3 '15 at 20:21
add a comment |
While it doesn't display speed, when copying multiple files, the -v
option to the cp
command will provide you with progress info. e.g.
cp -rv old-directory new-directory
6
Progress info? This is just verbose output. To provide progress info you would at least need to now how many files, or even which files, needs to be copied.
– Julian F. Weinert
Jul 3 '15 at 20:21
add a comment |
While it doesn't display speed, when copying multiple files, the -v
option to the cp
command will provide you with progress info. e.g.
cp -rv old-directory new-directory
While it doesn't display speed, when copying multiple files, the -v
option to the cp
command will provide you with progress info. e.g.
cp -rv old-directory new-directory
edited Jul 27 '14 at 18:53
BuZZ-dEE
9,235115169
9,235115169
answered Dec 14 '10 at 17:17
UbuntouristUbuntourist
63039
63039
6
Progress info? This is just verbose output. To provide progress info you would at least need to now how many files, or even which files, needs to be copied.
– Julian F. Weinert
Jul 3 '15 at 20:21
add a comment |
6
Progress info? This is just verbose output. To provide progress info you would at least need to now how many files, or even which files, needs to be copied.
– Julian F. Weinert
Jul 3 '15 at 20:21
6
6
Progress info? This is just verbose output. To provide progress info you would at least need to now how many files, or even which files, needs to be copied.
– Julian F. Weinert
Jul 3 '15 at 20:21
Progress info? This is just verbose output. To provide progress info you would at least need to now how many files, or even which files, needs to be copied.
– Julian F. Weinert
Jul 3 '15 at 20:21
add a comment |
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:
$ dd if=bigfile of=/tmp/otherbigfile &
$ showspeed dd
dd looks like a process name. pid=4417 matches av0=dd.
p/4417/fd/0r /home/jw/bigfile 113MB/s (12%, 2.3GB) 9m:35
p/4417/fd/1w /tmp/otherbigfile 182MB/s (2.6GB)
p/4417/fd/0r /home/jw/bigfile 285MB/s (15%, 3.0GB) 8m:08
p/4417/fd/0r /home/jw/bigfile 115MB/s (16%, 3.2GB) 8m:01
p/4417/fd/0r /home/jw/bigfile 107MB/s (17%, 3.4GB) 7m:39
p/4417/fd/1w /tmp/otherbigfile 104MB/s (3.5GB)
p/4417/fd/0r /home/jw/bigfile 139MB/s (19%, 3.7GB) 7m:37
p/4417/fd/0r /home/jw/bigfile 116MB/s (20%, 3.9GB) 7m:18
p/4417/fd/1w /tmp/otherbigfile 67MB/s (4.0GB)
p/4417/fd/1w /tmp/otherbigfile 100MB/s (4.1GB)
...
Nice one. How does it work out percentages though? I guess only in case of file s open as read only? And it will probably not work in case of scattered access.
– j_kubik
Dec 22 '14 at 17:29
1
In this case you can also use another terminal to runpkill -USR1 dd
to makedd
show its status, another option would bewatch -n 1 pkill -USR1 dd
to make it show its progress periodically (every second).
– Yaron
Mar 16 '15 at 9:23
Right. Many tools got a builtin way to report statistics over time. dd is no exception. Modern implementations have a status=progess option. Showspeed is a classic unix style "one tool for one purpose" solution - just like pv. But it has different usecases: Think of cups pumping a file through ghostscript or you want to know the ETA for an ongoing cp or tar. It might be 95% done already after a few hours and you probably don't want to restart that just to add pv ... Scattered access would not work well. Showspeed only samples seek positions.
– Jürgen Weigert
Apr 30 '18 at 19:22
add a comment |
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:
$ dd if=bigfile of=/tmp/otherbigfile &
$ showspeed dd
dd looks like a process name. pid=4417 matches av0=dd.
p/4417/fd/0r /home/jw/bigfile 113MB/s (12%, 2.3GB) 9m:35
p/4417/fd/1w /tmp/otherbigfile 182MB/s (2.6GB)
p/4417/fd/0r /home/jw/bigfile 285MB/s (15%, 3.0GB) 8m:08
p/4417/fd/0r /home/jw/bigfile 115MB/s (16%, 3.2GB) 8m:01
p/4417/fd/0r /home/jw/bigfile 107MB/s (17%, 3.4GB) 7m:39
p/4417/fd/1w /tmp/otherbigfile 104MB/s (3.5GB)
p/4417/fd/0r /home/jw/bigfile 139MB/s (19%, 3.7GB) 7m:37
p/4417/fd/0r /home/jw/bigfile 116MB/s (20%, 3.9GB) 7m:18
p/4417/fd/1w /tmp/otherbigfile 67MB/s (4.0GB)
p/4417/fd/1w /tmp/otherbigfile 100MB/s (4.1GB)
...
Nice one. How does it work out percentages though? I guess only in case of file s open as read only? And it will probably not work in case of scattered access.
– j_kubik
Dec 22 '14 at 17:29
1
In this case you can also use another terminal to runpkill -USR1 dd
to makedd
show its status, another option would bewatch -n 1 pkill -USR1 dd
to make it show its progress periodically (every second).
– Yaron
Mar 16 '15 at 9:23
Right. Many tools got a builtin way to report statistics over time. dd is no exception. Modern implementations have a status=progess option. Showspeed is a classic unix style "one tool for one purpose" solution - just like pv. But it has different usecases: Think of cups pumping a file through ghostscript or you want to know the ETA for an ongoing cp or tar. It might be 95% done already after a few hours and you probably don't want to restart that just to add pv ... Scattered access would not work well. Showspeed only samples seek positions.
– Jürgen Weigert
Apr 30 '18 at 19:22
add a comment |
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:
$ dd if=bigfile of=/tmp/otherbigfile &
$ showspeed dd
dd looks like a process name. pid=4417 matches av0=dd.
p/4417/fd/0r /home/jw/bigfile 113MB/s (12%, 2.3GB) 9m:35
p/4417/fd/1w /tmp/otherbigfile 182MB/s (2.6GB)
p/4417/fd/0r /home/jw/bigfile 285MB/s (15%, 3.0GB) 8m:08
p/4417/fd/0r /home/jw/bigfile 115MB/s (16%, 3.2GB) 8m:01
p/4417/fd/0r /home/jw/bigfile 107MB/s (17%, 3.4GB) 7m:39
p/4417/fd/1w /tmp/otherbigfile 104MB/s (3.5GB)
p/4417/fd/0r /home/jw/bigfile 139MB/s (19%, 3.7GB) 7m:37
p/4417/fd/0r /home/jw/bigfile 116MB/s (20%, 3.9GB) 7m:18
p/4417/fd/1w /tmp/otherbigfile 67MB/s (4.0GB)
p/4417/fd/1w /tmp/otherbigfile 100MB/s (4.1GB)
...
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:
$ dd if=bigfile of=/tmp/otherbigfile &
$ showspeed dd
dd looks like a process name. pid=4417 matches av0=dd.
p/4417/fd/0r /home/jw/bigfile 113MB/s (12%, 2.3GB) 9m:35
p/4417/fd/1w /tmp/otherbigfile 182MB/s (2.6GB)
p/4417/fd/0r /home/jw/bigfile 285MB/s (15%, 3.0GB) 8m:08
p/4417/fd/0r /home/jw/bigfile 115MB/s (16%, 3.2GB) 8m:01
p/4417/fd/0r /home/jw/bigfile 107MB/s (17%, 3.4GB) 7m:39
p/4417/fd/1w /tmp/otherbigfile 104MB/s (3.5GB)
p/4417/fd/0r /home/jw/bigfile 139MB/s (19%, 3.7GB) 7m:37
p/4417/fd/0r /home/jw/bigfile 116MB/s (20%, 3.9GB) 7m:18
p/4417/fd/1w /tmp/otherbigfile 67MB/s (4.0GB)
p/4417/fd/1w /tmp/otherbigfile 100MB/s (4.1GB)
...
edited Jul 6 '17 at 22:30
Community♦
1
1
answered Feb 25 '14 at 14:34
Jürgen WeigertJürgen Weigert
37124
37124
Nice one. How does it work out percentages though? I guess only in case of file s open as read only? And it will probably not work in case of scattered access.
– j_kubik
Dec 22 '14 at 17:29
1
In this case you can also use another terminal to runpkill -USR1 dd
to makedd
show its status, another option would bewatch -n 1 pkill -USR1 dd
to make it show its progress periodically (every second).
– Yaron
Mar 16 '15 at 9:23
Right. Many tools got a builtin way to report statistics over time. dd is no exception. Modern implementations have a status=progess option. Showspeed is a classic unix style "one tool for one purpose" solution - just like pv. But it has different usecases: Think of cups pumping a file through ghostscript or you want to know the ETA for an ongoing cp or tar. It might be 95% done already after a few hours and you probably don't want to restart that just to add pv ... Scattered access would not work well. Showspeed only samples seek positions.
– Jürgen Weigert
Apr 30 '18 at 19:22
add a comment |
Nice one. How does it work out percentages though? I guess only in case of file s open as read only? And it will probably not work in case of scattered access.
– j_kubik
Dec 22 '14 at 17:29
1
In this case you can also use another terminal to runpkill -USR1 dd
to makedd
show its status, another option would bewatch -n 1 pkill -USR1 dd
to make it show its progress periodically (every second).
– Yaron
Mar 16 '15 at 9:23
Right. Many tools got a builtin way to report statistics over time. dd is no exception. Modern implementations have a status=progess option. Showspeed is a classic unix style "one tool for one purpose" solution - just like pv. But it has different usecases: Think of cups pumping a file through ghostscript or you want to know the ETA for an ongoing cp or tar. It might be 95% done already after a few hours and you probably don't want to restart that just to add pv ... Scattered access would not work well. Showspeed only samples seek positions.
– Jürgen Weigert
Apr 30 '18 at 19:22
Nice one. How does it work out percentages though? I guess only in case of file s open as read only? And it will probably not work in case of scattered access.
– j_kubik
Dec 22 '14 at 17:29
Nice one. How does it work out percentages though? I guess only in case of file s open as read only? And it will probably not work in case of scattered access.
– j_kubik
Dec 22 '14 at 17:29
1
1
In this case you can also use another terminal to run
pkill -USR1 dd
to make dd
show its status, another option would be watch -n 1 pkill -USR1 dd
to make it show its progress periodically (every second).– Yaron
Mar 16 '15 at 9:23
In this case you can also use another terminal to run
pkill -USR1 dd
to make dd
show its status, another option would be watch -n 1 pkill -USR1 dd
to make it show its progress periodically (every second).– Yaron
Mar 16 '15 at 9:23
Right. Many tools got a builtin way to report statistics over time. dd is no exception. Modern implementations have a status=progess option. Showspeed is a classic unix style "one tool for one purpose" solution - just like pv. But it has different usecases: Think of cups pumping a file through ghostscript or you want to know the ETA for an ongoing cp or tar. It might be 95% done already after a few hours and you probably don't want to restart that just to add pv ... Scattered access would not work well. Showspeed only samples seek positions.
– Jürgen Weigert
Apr 30 '18 at 19:22
Right. Many tools got a builtin way to report statistics over time. dd is no exception. Modern implementations have a status=progess option. Showspeed is a classic unix style "one tool for one purpose" solution - just like pv. But it has different usecases: Think of cups pumping a file through ghostscript or you want to know the ETA for an ongoing cp or tar. It might be 95% done already after a few hours and you probably don't want to restart that just to add pv ... Scattered access would not work well. Showspeed only samples seek positions.
– Jürgen Weigert
Apr 30 '18 at 19:22
add a comment |
There is a tool called progress
in the repositories that is able to examine various different commands and display progress info for them.
Install it using the command
sudo apt-get install progress
This tool can be used like that:
cp bigfile newfile & progress -mp $!
Output:
[11471] cp /media/Backup/Downloads/FILENAME.file
29.9% (24.2 MiB / 16 MiB)
add a comment |
There is a tool called progress
in the repositories that is able to examine various different commands and display progress info for them.
Install it using the command
sudo apt-get install progress
This tool can be used like that:
cp bigfile newfile & progress -mp $!
Output:
[11471] cp /media/Backup/Downloads/FILENAME.file
29.9% (24.2 MiB / 16 MiB)
add a comment |
There is a tool called progress
in the repositories that is able to examine various different commands and display progress info for them.
Install it using the command
sudo apt-get install progress
This tool can be used like that:
cp bigfile newfile & progress -mp $!
Output:
[11471] cp /media/Backup/Downloads/FILENAME.file
29.9% (24.2 MiB / 16 MiB)
There is a tool called progress
in the repositories that is able to examine various different commands and display progress info for them.
Install it using the command
sudo apt-get install progress
This tool can be used like that:
cp bigfile newfile & progress -mp $!
Output:
[11471] cp /media/Backup/Downloads/FILENAME.file
29.9% (24.2 MiB / 16 MiB)
edited Sep 26 '16 at 23:39
Byte Commander
64.3k27176295
64.3k27176295
answered Sep 26 '16 at 22:35
Nathaniel A MalinowskiNathaniel A Malinowski
12112
12112
add a comment |
add a comment |
While pv
can deal with local cp
tasks, using dd
with pv
can deal with both local (cp
) and remote (scp
) tasks.
dd if=path/to/source.mkv | pv | dd of=path/to/dest.mkv
Please ensure the path/to/dest.mkv
exits by touch path/to/dest.mkv
This can show the progress, but if you want the percentage information,
dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
Replace 100M
above with the real size of your source file.
Here Comes the Remote Part
While scp
can hardly show current progress, using dd
with pv
is a piece of cake.
ssh onemach@myotherhost dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
1
Newerdd
hasstatus=progress
: askubuntu.com/a/824895/52975
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 14 '16 at 16:20
add a comment |
While pv
can deal with local cp
tasks, using dd
with pv
can deal with both local (cp
) and remote (scp
) tasks.
dd if=path/to/source.mkv | pv | dd of=path/to/dest.mkv
Please ensure the path/to/dest.mkv
exits by touch path/to/dest.mkv
This can show the progress, but if you want the percentage information,
dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
Replace 100M
above with the real size of your source file.
Here Comes the Remote Part
While scp
can hardly show current progress, using dd
with pv
is a piece of cake.
ssh onemach@myotherhost dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
1
Newerdd
hasstatus=progress
: askubuntu.com/a/824895/52975
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 14 '16 at 16:20
add a comment |
While pv
can deal with local cp
tasks, using dd
with pv
can deal with both local (cp
) and remote (scp
) tasks.
dd if=path/to/source.mkv | pv | dd of=path/to/dest.mkv
Please ensure the path/to/dest.mkv
exits by touch path/to/dest.mkv
This can show the progress, but if you want the percentage information,
dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
Replace 100M
above with the real size of your source file.
Here Comes the Remote Part
While scp
can hardly show current progress, using dd
with pv
is a piece of cake.
ssh onemach@myotherhost dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
While pv
can deal with local cp
tasks, using dd
with pv
can deal with both local (cp
) and remote (scp
) tasks.
dd if=path/to/source.mkv | pv | dd of=path/to/dest.mkv
Please ensure the path/to/dest.mkv
exits by touch path/to/dest.mkv
This can show the progress, but if you want the percentage information,
dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
Replace 100M
above with the real size of your source file.
Here Comes the Remote Part
While scp
can hardly show current progress, using dd
with pv
is a piece of cake.
ssh onemach@myotherhost dd if=path/to/source.mkv | pv -s 100M | dd of=path/to/dest.mkv
edited Oct 24 '15 at 20:40
muru
1
1
answered Jan 5 '13 at 8:08
onemachonemach
216137
216137
1
Newerdd
hasstatus=progress
: askubuntu.com/a/824895/52975
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 14 '16 at 16:20
add a comment |
1
Newerdd
hasstatus=progress
: askubuntu.com/a/824895/52975
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 14 '16 at 16:20
1
1
Newer
dd
has status=progress
: askubuntu.com/a/824895/52975– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 14 '16 at 16:20
Newer
dd
has status=progress
: askubuntu.com/a/824895/52975– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 14 '16 at 16:20
add a comment |
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
cv -w
outputs the stats for all running cp,mv etc. operations
watch cv -q
is even neater
– nwgat
Jan 19 '15 at 0:42
It only show progress for an individual files, it does realise whether acp
is copying a directory recursively or not.
– Flimm
Mar 31 '16 at 9:27
It war renamed to progress. Great tool!
– sebastian
Jun 25 '16 at 14:42
add a comment |
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
cv -w
outputs the stats for all running cp,mv etc. operations
watch cv -q
is even neater
– nwgat
Jan 19 '15 at 0:42
It only show progress for an individual files, it does realise whether acp
is copying a directory recursively or not.
– Flimm
Mar 31 '16 at 9:27
It war renamed to progress. Great tool!
– sebastian
Jun 25 '16 at 14:42
add a comment |
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
cv -w
outputs the stats for all running cp,mv etc. operations
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
cv -w
outputs the stats for all running cp,mv etc. operations
answered Jul 13 '14 at 11:33
naugturnaugtur
20626
20626
watch cv -q
is even neater
– nwgat
Jan 19 '15 at 0:42
It only show progress for an individual files, it does realise whether acp
is copying a directory recursively or not.
– Flimm
Mar 31 '16 at 9:27
It war renamed to progress. Great tool!
– sebastian
Jun 25 '16 at 14:42
add a comment |
watch cv -q
is even neater
– nwgat
Jan 19 '15 at 0:42
It only show progress for an individual files, it does realise whether acp
is copying a directory recursively or not.
– Flimm
Mar 31 '16 at 9:27
It war renamed to progress. Great tool!
– sebastian
Jun 25 '16 at 14:42
watch cv -q
is even neater– nwgat
Jan 19 '15 at 0:42
watch cv -q
is even neater– nwgat
Jan 19 '15 at 0:42
It only show progress for an individual files, it does realise whether a
cp
is copying a directory recursively or not.– Flimm
Mar 31 '16 at 9:27
It only show progress for an individual files, it does realise whether a
cp
is copying a directory recursively or not.– Flimm
Mar 31 '16 at 9:27
It war renamed to progress. Great tool!
– sebastian
Jun 25 '16 at 14:42
It war renamed to progress. Great tool!
– sebastian
Jun 25 '16 at 14:42
add a comment |
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 -R
):
See how big the file is and remember
Start copying
Open another terminal
Run
watch ls -lh DIR
on the directory where the target is
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 watch du -hs DIR
to see summary of DIR size. However du can take long to compute and can even slow down the copying, so you might want to use -n INTERVAL
argument to watch so that trade-off is acceptable.
Update: In case you use wild-cards with command used with watch du, e.g. watch du -hs backup/*
, don't forget to quote:
watch "du -hs backup/*"
otherwise the wild-cards will be expanded only once, when watch is started so du will not look at new files / subdirectories.
Does not answer the "speed" part, though...
– Alois Mahdal
Nov 16 '12 at 13:21
add a comment |
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 -R
):
See how big the file is and remember
Start copying
Open another terminal
Run
watch ls -lh DIR
on the directory where the target is
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 watch du -hs DIR
to see summary of DIR size. However du can take long to compute and can even slow down the copying, so you might want to use -n INTERVAL
argument to watch so that trade-off is acceptable.
Update: In case you use wild-cards with command used with watch du, e.g. watch du -hs backup/*
, don't forget to quote:
watch "du -hs backup/*"
otherwise the wild-cards will be expanded only once, when watch is started so du will not look at new files / subdirectories.
Does not answer the "speed" part, though...
– Alois Mahdal
Nov 16 '12 at 13:21
add a comment |
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 -R
):
See how big the file is and remember
Start copying
Open another terminal
Run
watch ls -lh DIR
on the directory where the target is
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 watch du -hs DIR
to see summary of DIR size. However du can take long to compute and can even slow down the copying, so you might want to use -n INTERVAL
argument to watch so that trade-off is acceptable.
Update: In case you use wild-cards with command used with watch du, e.g. watch du -hs backup/*
, don't forget to quote:
watch "du -hs backup/*"
otherwise the wild-cards will be expanded only once, when watch is started so du will not look at new files / subdirectories.
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 -R
):
See how big the file is and remember
Start copying
Open another terminal
Run
watch ls -lh DIR
on the directory where the target is
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 watch du -hs DIR
to see summary of DIR size. However du can take long to compute and can even slow down the copying, so you might want to use -n INTERVAL
argument to watch so that trade-off is acceptable.
Update: In case you use wild-cards with command used with watch du, e.g. watch du -hs backup/*
, don't forget to quote:
watch "du -hs backup/*"
otherwise the wild-cards will be expanded only once, when watch is started so du will not look at new files / subdirectories.
edited Nov 16 '12 at 13:32
answered Nov 16 '12 at 13:20
Alois MahdalAlois Mahdal
422512
422512
Does not answer the "speed" part, though...
– Alois Mahdal
Nov 16 '12 at 13:21
add a comment |
Does not answer the "speed" part, though...
– Alois Mahdal
Nov 16 '12 at 13:21
Does not answer the "speed" part, though...
– Alois Mahdal
Nov 16 '12 at 13:21
Does not answer the "speed" part, though...
– Alois Mahdal
Nov 16 '12 at 13:21
add a comment |
dd status=progress
Option added in GNU Coreutils 8.24+ (Ubuntu 16.04):
dd if=src of=dst status=progress
The terminal shows a line of type:
462858752 bytes (463 MB, 441 MiB) copied, 38 s, 12,2 MB/s
See also: How do you monitor the progress of dd?
1
You meant: stdout is a stream of characters and vt100 escape sequences that make your terminal display a periodically updated line ;). stdout is always a stream of bytes and has nothing to do with how it is displayed (except that the application can know whether it is currently attached to a terminal or not...)
– masterxilo
Sep 4 '18 at 9:20
@masterxilo newbs won't care, experts will know ;-) hehe
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 4 '18 at 9:33
Well I think it's always good to state things like they are, maybe leaving out some details, but never make your readers produce a wrong mental model. If you say "stdout is a (periodically updated) line" it seems like you are saying stdout is a block of mutable memory which it is not. This is important to know even for newbies.
– masterxilo
Sep 7 '18 at 9:09
add a comment |
dd status=progress
Option added in GNU Coreutils 8.24+ (Ubuntu 16.04):
dd if=src of=dst status=progress
The terminal shows a line of type:
462858752 bytes (463 MB, 441 MiB) copied, 38 s, 12,2 MB/s
See also: How do you monitor the progress of dd?
1
You meant: stdout is a stream of characters and vt100 escape sequences that make your terminal display a periodically updated line ;). stdout is always a stream of bytes and has nothing to do with how it is displayed (except that the application can know whether it is currently attached to a terminal or not...)
– masterxilo
Sep 4 '18 at 9:20
@masterxilo newbs won't care, experts will know ;-) hehe
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 4 '18 at 9:33
Well I think it's always good to state things like they are, maybe leaving out some details, but never make your readers produce a wrong mental model. If you say "stdout is a (periodically updated) line" it seems like you are saying stdout is a block of mutable memory which it is not. This is important to know even for newbies.
– masterxilo
Sep 7 '18 at 9:09
add a comment |
dd status=progress
Option added in GNU Coreutils 8.24+ (Ubuntu 16.04):
dd if=src of=dst status=progress
The terminal shows a line of type:
462858752 bytes (463 MB, 441 MiB) copied, 38 s, 12,2 MB/s
See also: How do you monitor the progress of dd?
dd status=progress
Option added in GNU Coreutils 8.24+ (Ubuntu 16.04):
dd if=src of=dst status=progress
The terminal shows a line of type:
462858752 bytes (463 MB, 441 MiB) copied, 38 s, 12,2 MB/s
See also: How do you monitor the progress of dd?
edited Sep 7 '18 at 9:13
answered Sep 14 '16 at 16:18
Ciro Santilli 新疆改造中心 六四事件 法轮功Ciro Santilli 新疆改造中心 六四事件 法轮功
9,65944448
9,65944448
1
You meant: stdout is a stream of characters and vt100 escape sequences that make your terminal display a periodically updated line ;). stdout is always a stream of bytes and has nothing to do with how it is displayed (except that the application can know whether it is currently attached to a terminal or not...)
– masterxilo
Sep 4 '18 at 9:20
@masterxilo newbs won't care, experts will know ;-) hehe
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 4 '18 at 9:33
Well I think it's always good to state things like they are, maybe leaving out some details, but never make your readers produce a wrong mental model. If you say "stdout is a (periodically updated) line" it seems like you are saying stdout is a block of mutable memory which it is not. This is important to know even for newbies.
– masterxilo
Sep 7 '18 at 9:09
add a comment |
1
You meant: stdout is a stream of characters and vt100 escape sequences that make your terminal display a periodically updated line ;). stdout is always a stream of bytes and has nothing to do with how it is displayed (except that the application can know whether it is currently attached to a terminal or not...)
– masterxilo
Sep 4 '18 at 9:20
@masterxilo newbs won't care, experts will know ;-) hehe
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 4 '18 at 9:33
Well I think it's always good to state things like they are, maybe leaving out some details, but never make your readers produce a wrong mental model. If you say "stdout is a (periodically updated) line" it seems like you are saying stdout is a block of mutable memory which it is not. This is important to know even for newbies.
– masterxilo
Sep 7 '18 at 9:09
1
1
You meant: stdout is a stream of characters and vt100 escape sequences that make your terminal display a periodically updated line ;). stdout is always a stream of bytes and has nothing to do with how it is displayed (except that the application can know whether it is currently attached to a terminal or not...)
– masterxilo
Sep 4 '18 at 9:20
You meant: stdout is a stream of characters and vt100 escape sequences that make your terminal display a periodically updated line ;). stdout is always a stream of bytes and has nothing to do with how it is displayed (except that the application can know whether it is currently attached to a terminal or not...)
– masterxilo
Sep 4 '18 at 9:20
@masterxilo newbs won't care, experts will know ;-) hehe
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 4 '18 at 9:33
@masterxilo newbs won't care, experts will know ;-) hehe
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Sep 4 '18 at 9:33
Well I think it's always good to state things like they are, maybe leaving out some details, but never make your readers produce a wrong mental model. If you say "stdout is a (periodically updated) line" it seems like you are saying stdout is a block of mutable memory which it is not. This is important to know even for newbies.
– masterxilo
Sep 7 '18 at 9:09
Well I think it's always good to state things like they are, maybe leaving out some details, but never make your readers produce a wrong mental model. If you say "stdout is a (periodically updated) line" it seems like you are saying stdout is a block of mutable memory which it is not. This is important to know even for newbies.
– masterxilo
Sep 7 '18 at 9:09
add a comment |
Depending on what you want to do, Midnight Commander (mc
) might be the answer. I'm surprised it's not been mentioned yet.
Tools like pv
or rsync
are good to display progress of transfer of one huge file, but when it comes to copying whole directories/trees, mc
calculates the size and then displays the progress very nicely. Plus it's available out of the box on majority of systems.
1
"it's available out of the box on majority of systems." ... not on any default Ubuntu installation.
– muru
Jan 30 '16 at 17:58
add a comment |
Depending on what you want to do, Midnight Commander (mc
) might be the answer. I'm surprised it's not been mentioned yet.
Tools like pv
or rsync
are good to display progress of transfer of one huge file, but when it comes to copying whole directories/trees, mc
calculates the size and then displays the progress very nicely. Plus it's available out of the box on majority of systems.
1
"it's available out of the box on majority of systems." ... not on any default Ubuntu installation.
– muru
Jan 30 '16 at 17:58
add a comment |
Depending on what you want to do, Midnight Commander (mc
) might be the answer. I'm surprised it's not been mentioned yet.
Tools like pv
or rsync
are good to display progress of transfer of one huge file, but when it comes to copying whole directories/trees, mc
calculates the size and then displays the progress very nicely. Plus it's available out of the box on majority of systems.
Depending on what you want to do, Midnight Commander (mc
) might be the answer. I'm surprised it's not been mentioned yet.
Tools like pv
or rsync
are good to display progress of transfer of one huge file, but when it comes to copying whole directories/trees, mc
calculates the size and then displays the progress very nicely. Plus it's available out of the box on majority of systems.
answered Jan 30 '16 at 17:33
kralykkralyk
1312
1312
1
"it's available out of the box on majority of systems." ... not on any default Ubuntu installation.
– muru
Jan 30 '16 at 17:58
add a comment |
1
"it's available out of the box on majority of systems." ... not on any default Ubuntu installation.
– muru
Jan 30 '16 at 17:58
1
1
"it's available out of the box on majority of systems." ... not on any default Ubuntu installation.
– muru
Jan 30 '16 at 17:58
"it's available out of the box on majority of systems." ... not on any default Ubuntu installation.
– muru
Jan 30 '16 at 17:58
add a comment |
If you have rsync 3.1 or higher (rsync --version
), you can copy (cp -Rpn) while preserving permissions and ownership, recurse directories, "no clobber," and display overall progress (instead of just progress by file), copy rate, and (very rough) estimated time remaining with:
sudo rsync -a --info=progress2 --no-i-r /source /destination
Note that sudo is only needed if dealing with directories/files you don't own. Also, without the --no-i-r
, the percentage may reset to a lower number at some point during the copy. Perhaps later versions of rsync will default to no-i-r with info=progress2, but it does not in the current version of 3.1.2.
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").
add a comment |
If you have rsync 3.1 or higher (rsync --version
), you can copy (cp -Rpn) while preserving permissions and ownership, recurse directories, "no clobber," and display overall progress (instead of just progress by file), copy rate, and (very rough) estimated time remaining with:
sudo rsync -a --info=progress2 --no-i-r /source /destination
Note that sudo is only needed if dealing with directories/files you don't own. Also, without the --no-i-r
, the percentage may reset to a lower number at some point during the copy. Perhaps later versions of rsync will default to no-i-r with info=progress2, but it does not in the current version of 3.1.2.
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").
add a comment |
If you have rsync 3.1 or higher (rsync --version
), you can copy (cp -Rpn) while preserving permissions and ownership, recurse directories, "no clobber," and display overall progress (instead of just progress by file), copy rate, and (very rough) estimated time remaining with:
sudo rsync -a --info=progress2 --no-i-r /source /destination
Note that sudo is only needed if dealing with directories/files you don't own. Also, without the --no-i-r
, the percentage may reset to a lower number at some point during the copy. Perhaps later versions of rsync will default to no-i-r with info=progress2, but it does not in the current version of 3.1.2.
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").
If you have rsync 3.1 or higher (rsync --version
), you can copy (cp -Rpn) while preserving permissions and ownership, recurse directories, "no clobber," and display overall progress (instead of just progress by file), copy rate, and (very rough) estimated time remaining with:
sudo rsync -a --info=progress2 --no-i-r /source /destination
Note that sudo is only needed if dealing with directories/files you don't own. Also, without the --no-i-r
, the percentage may reset to a lower number at some point during the copy. Perhaps later versions of rsync will default to no-i-r with info=progress2, but it does not in the current version of 3.1.2.
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").
edited Mar 3 '16 at 1:12
answered Mar 2 '16 at 22:22
S LentzS Lentz
312
312
add a comment |
add a comment |
Use a shell script:
#!/bin/sh
cp_p()
{
strace -q -ewrite cp -- "${1}" "${2}" 2>&1
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
printf "%3d%% [", percent
for (i=0;i<=percent;i++)
printf "="
printf ">"
for (i=percent;i<100;i++)
printf " "
printf "]r"
}
}
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
}
This will look like:
% cp_p /home/echox/foo.dat /home/echox/bar.dat
66% [===============================> ]
Source
add a comment |
Use a shell script:
#!/bin/sh
cp_p()
{
strace -q -ewrite cp -- "${1}" "${2}" 2>&1
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
printf "%3d%% [", percent
for (i=0;i<=percent;i++)
printf "="
printf ">"
for (i=percent;i<100;i++)
printf " "
printf "]r"
}
}
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
}
This will look like:
% cp_p /home/echox/foo.dat /home/echox/bar.dat
66% [===============================> ]
Source
add a comment |
Use a shell script:
#!/bin/sh
cp_p()
{
strace -q -ewrite cp -- "${1}" "${2}" 2>&1
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
printf "%3d%% [", percent
for (i=0;i<=percent;i++)
printf "="
printf ">"
for (i=percent;i<100;i++)
printf " "
printf "]r"
}
}
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
}
This will look like:
% cp_p /home/echox/foo.dat /home/echox/bar.dat
66% [===============================> ]
Source
Use a shell script:
#!/bin/sh
cp_p()
{
strace -q -ewrite cp -- "${1}" "${2}" 2>&1
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
printf "%3d%% [", percent
for (i=0;i<=percent;i++)
printf "="
printf ">"
for (i=percent;i<100;i++)
printf " "
printf "]r"
}
}
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
}
This will look like:
% cp_p /home/echox/foo.dat /home/echox/bar.dat
66% [===============================> ]
Source
edited Apr 13 '17 at 12:37
Community♦
1
1
answered Sep 1 '14 at 13:45
JanJan
7,38522234
7,38522234
add a comment |
add a comment |
one more option to preserve attributes could be (if source
is a folder it will be created in destination
)
tar -c source | pv -e -t -p -r | tar -C destination -x
hope it may be useful to someone. To have estimated transfer time this can be acheived by doing do -s source
in advance and passing it as a -s <size>
parameter to pv
.
-f -
is redundant.tar
's default output forc
and input forx
are stdout and stdin.
– muru
Oct 17 '18 at 16:34
May it depend on the OS/tar version? I know it’s an Ubuntu site yet this may be useful for other OS owners like macOS
– ciekawy
Oct 17 '18 at 16:39
1
Nope. All sane implementations (including libarchive's tar, which macOS uses) have this behaviour.
– muru
Oct 17 '18 at 16:46
just verified on macos and your suggestion is perfectly valid - I've updated my answer. Thanks!
– ciekawy
Oct 17 '18 at 17:21
add a comment |
one more option to preserve attributes could be (if source
is a folder it will be created in destination
)
tar -c source | pv -e -t -p -r | tar -C destination -x
hope it may be useful to someone. To have estimated transfer time this can be acheived by doing do -s source
in advance and passing it as a -s <size>
parameter to pv
.
-f -
is redundant.tar
's default output forc
and input forx
are stdout and stdin.
– muru
Oct 17 '18 at 16:34
May it depend on the OS/tar version? I know it’s an Ubuntu site yet this may be useful for other OS owners like macOS
– ciekawy
Oct 17 '18 at 16:39
1
Nope. All sane implementations (including libarchive's tar, which macOS uses) have this behaviour.
– muru
Oct 17 '18 at 16:46
just verified on macos and your suggestion is perfectly valid - I've updated my answer. Thanks!
– ciekawy
Oct 17 '18 at 17:21
add a comment |
one more option to preserve attributes could be (if source
is a folder it will be created in destination
)
tar -c source | pv -e -t -p -r | tar -C destination -x
hope it may be useful to someone. To have estimated transfer time this can be acheived by doing do -s source
in advance and passing it as a -s <size>
parameter to pv
.
one more option to preserve attributes could be (if source
is a folder it will be created in destination
)
tar -c source | pv -e -t -p -r | tar -C destination -x
hope it may be useful to someone. To have estimated transfer time this can be acheived by doing do -s source
in advance and passing it as a -s <size>
parameter to pv
.
edited Oct 17 '18 at 17:20
answered Oct 17 '18 at 16:10
ciekawyciekawy
1112
1112
-f -
is redundant.tar
's default output forc
and input forx
are stdout and stdin.
– muru
Oct 17 '18 at 16:34
May it depend on the OS/tar version? I know it’s an Ubuntu site yet this may be useful for other OS owners like macOS
– ciekawy
Oct 17 '18 at 16:39
1
Nope. All sane implementations (including libarchive's tar, which macOS uses) have this behaviour.
– muru
Oct 17 '18 at 16:46
just verified on macos and your suggestion is perfectly valid - I've updated my answer. Thanks!
– ciekawy
Oct 17 '18 at 17:21
add a comment |
-f -
is redundant.tar
's default output forc
and input forx
are stdout and stdin.
– muru
Oct 17 '18 at 16:34
May it depend on the OS/tar version? I know it’s an Ubuntu site yet this may be useful for other OS owners like macOS
– ciekawy
Oct 17 '18 at 16:39
1
Nope. All sane implementations (including libarchive's tar, which macOS uses) have this behaviour.
– muru
Oct 17 '18 at 16:46
just verified on macos and your suggestion is perfectly valid - I've updated my answer. Thanks!
– ciekawy
Oct 17 '18 at 17:21
-f -
is redundant. tar
's default output for c
and input for x
are stdout and stdin.– muru
Oct 17 '18 at 16:34
-f -
is redundant. tar
's default output for c
and input for x
are stdout and stdin.– muru
Oct 17 '18 at 16:34
May it depend on the OS/tar version? I know it’s an Ubuntu site yet this may be useful for other OS owners like macOS
– ciekawy
Oct 17 '18 at 16:39
May it depend on the OS/tar version? I know it’s an Ubuntu site yet this may be useful for other OS owners like macOS
– ciekawy
Oct 17 '18 at 16:39
1
1
Nope. All sane implementations (including libarchive's tar, which macOS uses) have this behaviour.
– muru
Oct 17 '18 at 16:46
Nope. All sane implementations (including libarchive's tar, which macOS uses) have this behaviour.
– muru
Oct 17 '18 at 16:46
just verified on macos and your suggestion is perfectly valid - I've updated my answer. Thanks!
– ciekawy
Oct 17 '18 at 17:21
just verified on macos and your suggestion is perfectly valid - I've updated my answer. Thanks!
– ciekawy
Oct 17 '18 at 17:21
add a comment |
You can copy use any program. At the same time, you can start sudo iotop
and see the actually disk read/write speed yet without progress.
add a comment |
You can copy use any program. At the same time, you can start sudo iotop
and see the actually disk read/write speed yet without progress.
add a comment |
You can copy use any program. At the same time, you can start sudo iotop
and see the actually disk read/write speed yet without progress.
You can copy use any program. At the same time, you can start sudo iotop
and see the actually disk read/write speed yet without progress.
answered Jan 11 '18 at 15:47
McKelvinMcKelvin
24124
24124
add a comment |
add a comment |
Check the source code for progress_bar in the below git repository
https://github.com/Kiran-Bose/supreme
Also try the custom bash script package supreme
Download the deb file and install in debian based distribution or download the source files, modify and use for other distros
Functionality overview
(1)Open Apps
----Firefox
----Calculator
----Settings
(2)Manage Files
----Search
----Navigate
----Quick access
|----Select File(s)
|----Inverse Selection
|----Make directory
|----Make file
|----Open
|----Copy
|----Move
|----Delete
|----Rename
|----Send to Device
|----Properties
(3)Manage Phone
----Move/Copy from phone
----Move/Copy to phone
----Sync folders
(4)Manage USB
----Move/Copy from USB
----Move/Copy to USB
add a comment |
Check the source code for progress_bar in the below git repository
https://github.com/Kiran-Bose/supreme
Also try the custom bash script package supreme
Download the deb file and install in debian based distribution or download the source files, modify and use for other distros
Functionality overview
(1)Open Apps
----Firefox
----Calculator
----Settings
(2)Manage Files
----Search
----Navigate
----Quick access
|----Select File(s)
|----Inverse Selection
|----Make directory
|----Make file
|----Open
|----Copy
|----Move
|----Delete
|----Rename
|----Send to Device
|----Properties
(3)Manage Phone
----Move/Copy from phone
----Move/Copy to phone
----Sync folders
(4)Manage USB
----Move/Copy from USB
----Move/Copy to USB
add a comment |
Check the source code for progress_bar in the below git repository
https://github.com/Kiran-Bose/supreme
Also try the custom bash script package supreme
Download the deb file and install in debian based distribution or download the source files, modify and use for other distros
Functionality overview
(1)Open Apps
----Firefox
----Calculator
----Settings
(2)Manage Files
----Search
----Navigate
----Quick access
|----Select File(s)
|----Inverse Selection
|----Make directory
|----Make file
|----Open
|----Copy
|----Move
|----Delete
|----Rename
|----Send to Device
|----Properties
(3)Manage Phone
----Move/Copy from phone
----Move/Copy to phone
----Sync folders
(4)Manage USB
----Move/Copy from USB
----Move/Copy to USB
Check the source code for progress_bar in the below git repository
https://github.com/Kiran-Bose/supreme
Also try the custom bash script package supreme
Download the deb file and install in debian based distribution or download the source files, modify and use for other distros
Functionality overview
(1)Open Apps
----Firefox
----Calculator
----Settings
(2)Manage Files
----Search
----Navigate
----Quick access
|----Select File(s)
|----Inverse Selection
|----Make directory
|----Make file
|----Open
|----Copy
|----Move
|----Delete
|----Rename
|----Send to Device
|----Properties
(3)Manage Phone
----Move/Copy from phone
----Move/Copy to phone
----Sync folders
(4)Manage USB
----Move/Copy from USB
----Move/Copy to USB
answered Sep 10 '18 at 14:54
KIRAN BKIRAN B
414
414
add a comment |
add a comment |
pv knows how to watch file descriptors given a pid, whether it's cp or something else
From the documentation:
(Linux only): Watching file descriptor 3 opened by another process 1234:
pv -d 1234:3
(Linux only): Watching all file descriptors used by process 1234:
pv -d 1234
Example:
md5sum file &
[1] + 1271 suspended
pv -d 1271
417MiB 0:00:17 [12,1MiB/s] [============> ] 29% ETA 0:00:53
$ cp file.mov copy.mov &
[2] 3731
$ pv -d 3731
3:/media/windows/file.mov: 754MiB 0:00:04 [97,2MiB/s] [======================> ] 52% ETA 0:00:07
4:/media/windows/copy.mov: 754MiB 0:00:04 [97,3MiB/s] [ <=> ]
add a comment |
pv knows how to watch file descriptors given a pid, whether it's cp or something else
From the documentation:
(Linux only): Watching file descriptor 3 opened by another process 1234:
pv -d 1234:3
(Linux only): Watching all file descriptors used by process 1234:
pv -d 1234
Example:
md5sum file &
[1] + 1271 suspended
pv -d 1271
417MiB 0:00:17 [12,1MiB/s] [============> ] 29% ETA 0:00:53
$ cp file.mov copy.mov &
[2] 3731
$ pv -d 3731
3:/media/windows/file.mov: 754MiB 0:00:04 [97,2MiB/s] [======================> ] 52% ETA 0:00:07
4:/media/windows/copy.mov: 754MiB 0:00:04 [97,3MiB/s] [ <=> ]
add a comment |
pv knows how to watch file descriptors given a pid, whether it's cp or something else
From the documentation:
(Linux only): Watching file descriptor 3 opened by another process 1234:
pv -d 1234:3
(Linux only): Watching all file descriptors used by process 1234:
pv -d 1234
Example:
md5sum file &
[1] + 1271 suspended
pv -d 1271
417MiB 0:00:17 [12,1MiB/s] [============> ] 29% ETA 0:00:53
$ cp file.mov copy.mov &
[2] 3731
$ pv -d 3731
3:/media/windows/file.mov: 754MiB 0:00:04 [97,2MiB/s] [======================> ] 52% ETA 0:00:07
4:/media/windows/copy.mov: 754MiB 0:00:04 [97,3MiB/s] [ <=> ]
pv knows how to watch file descriptors given a pid, whether it's cp or something else
From the documentation:
(Linux only): Watching file descriptor 3 opened by another process 1234:
pv -d 1234:3
(Linux only): Watching all file descriptors used by process 1234:
pv -d 1234
Example:
md5sum file &
[1] + 1271 suspended
pv -d 1271
417MiB 0:00:17 [12,1MiB/s] [============> ] 29% ETA 0:00:53
$ cp file.mov copy.mov &
[2] 3731
$ pv -d 3731
3:/media/windows/file.mov: 754MiB 0:00:04 [97,2MiB/s] [======================> ] 52% ETA 0:00:07
4:/media/windows/copy.mov: 754MiB 0:00:04 [97,3MiB/s] [ <=> ]
answered yesterday
alecailalecail
141212
141212
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f17275%2fhow-to-show-the-transfer-progress-and-speed-when-copying-files-with-cp%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown