Situation: If I entered a copy command like cp -rf /src/ /dsc/ then I am waiting several minutes for copy large directories. I forgot to put -v flag to verbose an output, Can I do it during copying?
- 193,181
- 53
- 473
- 722
- 8,205
- 10
- 33
- 35
5 Answers
This question seems to be old, but for the cp command you've got the --verbose option.
So the command works as follows:
cp --verbose -rf /src/ /dsc/
- 2,486
- 3
- 25
- 35
- 1,299
- 2
- 8
- 3
-
4someone mark this a correct answer – Orphans Nov 23 '16 at 20:04
-
8This is ideally what one *should* have done, but the point of the question was, what can you do to monitor the copy progress if you forgot to do this for a large operation. – merv Dec 23 '16 at 04:08
-
1on mac terminal, this gives `cp: illegal option -- -` – muon Jul 19 '18 at 17:54
-
4although `cp -rv ` works – muon Jul 19 '18 at 18:11
-
4`cp -v -r` will indicate that you want to display files being copied (as specified by `-v`), and `-r` will indicate that you want to recursively copy files, which will be needed if you are copying any sub-directories. – Ali Nobari Jan 04 '19 at 06:22
No you can't, but you could use the watch command to look at the destination directory to see how the process is progressing, eg.
watch ls -l /dsc/
- 8,295
- 1
- 34
- 39
-
5Please add `watch "find . | wc -l"` as well. I found it better since your command only shows one level depth. – guy mograbi Jan 07 '15 at 08:29
You could always use rsync instead, you'll atleast get to see the files that are being copied
rsync -rva /src/ /dst/
Of-course this only works before you start copying as an alternative to cp. The good news is though that rsync will only copy the files it needs to so you can kill your long-running cp command run the rsync command and it will pick up where cp left off.
- 161
- 1
- 2
I propose :
watch du -sh /dsc/
- 81
- 1
- 1
-
5Since this is just an improvement to an existing answer, consider suggesting an [edit] instead. – muru Jun 20 '15 at 16:21
I recommend to use Midnight Commander in case when you need to see a progress of files copying.
Install Midnight commander:
apt-get install mcOpen it:
mcOn first panel open source, on second - destination. Start copying using "F5".
MC will display nice and informative progress dialog.
- 41
- 2