68

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?

muru
  • 207,970
Smile.Hunter
  • 8,735

5 Answers5

138

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/
grooveplex
  • 2,506
myolli4
  • 1,489
46

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/
fabricator4
  • 8,481
  • 5
    Please 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
  • How to deal with space in the path ? usual " " , ' ' or escaping \ doesn't seem to to work for watch ls -l /path with spaces/ – Greenmarty Apr 08 '24 at 08:37
17

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.

kiiadi
  • 271
8

I propose :

watch du -sh /dsc/
odile
  • 81
  • 5
    Since this is just an improvement to an existing answer, consider suggesting an [edit] instead. – muru Jun 20 '15 at 16:21
3

I recommend to use Midnight Commander in case when you need to see a progress of files copying.

  1. Install Midnight commander:

    apt-get install mc
    
  2. Open it:

    mc
    
  3. On first panel open source, on second - destination. Start copying using "F5".

MC will display nice and informative progress dialog.